|
I2C Communication between RoboRIO and Arduino
Hello,
So I've been trying to send data from the RoboRIO to the Arduino UNO using the Transaction() function of the I2C Class of the C++ WPILib. I have the address all connected, because AddressOnly() returns false, meaning a success. However, Transaction() returns true, meaning the process aborted, and that's my problem. It's not a problem on the Arduino side because its not receiving any data at all.
I have switched off and on between using the built in I2C port and the MXP port on the RoboRIO, but neither have worked. I have the SDA, SCL, and Ground pins set up, but not the voltage, as the Arduino would not operate at 3.3V. Moreover, I just have the Arduino plugged into a computer. I would assume the wiring is good because the RoboRIO can sense that there is a device at the Arduino I2C address.
Here is some of the code on the RoboRIO side:
Header File (.h):
char START_INDICATOR = 'S';
unsigned char byteDataToSend;
unsigned char* CONVERTED_START_INDICATOR;
.cpp File
CONVERTED_START_INDICATOR = new unsigned char;
byteDataToSend = reinterpret_cast<unsigned char&>(START_INDICATOR)
CONVERTED_START_INDICATOR = &byteDataToSend;
i2C->Transmission(CONVERTED_START_INDICATOR , 1, NULL, 0)
Any help is appreciated, thanks
|