View Single Post
  #6   Spotlight this post!  
Unread 01-13-2015, 11:34 AM
SoftwareRachel's Avatar
SoftwareRachel SoftwareRachel is offline
Registered User
FRC #4505
 
Join Date: Feb 2014
Location: Maryland
Posts: 12
SoftwareRachel is an unknown quantity at this point
Re: Need help with arduino to i2c on roborio!

Quote:
Originally Posted by ThomasClark View Post
This I2C tutorial will still work on a roboRIO, if you make a couple changes. Mainly, your robotInit() method just needs to have this:

Code:
public void robotInit() {
    i2c = new I2C(I2C.Port.kOnboard, 168);
}
Another easy way would be to just use USB. Use the SerialPort class in your Java code to send data to the Arduino, and use Serial.read() on the Arduino to get the data. This has the advantage that it's really easy to test using the Serial Console in the Arduino IDE.
Thank you! That helps out a lot!
Reply With Quote