View Single Post
  #7   Spotlight this post!  
Unread 01-13-2015, 11:38 AM
seg9585's Avatar
seg9585 seg9585 is offline
Registered User
AKA: Eric
FRC #4276 (Surf City Vikings)
Team Role: Engineer
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Boeing (Seal Beach, CA)
Posts: 517
seg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond reputeseg9585 has a reputation beyond repute
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.
Let me know if the I2C method actually works, so far we have been unable to get communication working on the I2C OnBoard port, only the MXP. We suspect it's an issue specific to Java (See thread about the LIDAR sensor in the Technical forum)
__________________
My FIRST legacy:

Team 204 Student 2001, 2002 (Voorhees, NJ)
Team 1493 College Mentor 2006 - 2008 (Troy, NY)
Team 2150 Intern/Professional Mentor 2007, 2009 (Palos Verdes)
Team 4123 Lead Engineering Mentor 2012 (Bellflower, CA)
Team 4276 Engineering Mentor 2012-2016 (Huntington Beach, CA)
Reply With Quote