View Single Post
  #5   Spotlight this post!  
Unread 01-12-2015, 02:07 AM
ThomasClark's Avatar
ThomasClark ThomasClark is offline
Registered User
FRC #0237
 
Join Date: Dec 2012
Location: Watertown, CT
Posts: 146
ThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud ofThomasClark has much to be proud of
Re: Need help with arduino to i2c on roborio!

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.
Reply With Quote