Version 2 (modified by 10 years ago) (diff) | ,
---|
Using the RoboRIO's Serial Ports
The roboRIO has two serial ports: one in the MXP using TTL (pins 10 and 14) and another dedicated serial port using RS232.
Port Number | |
RS232 Serial | |
TTL Serial (MXP) |
The Interface team (Sensors-Software Communication Squad) (Nathan and Alex, with help from Mr. Albert) have gotten TTL communication working with an Arduino at 9600 baud. Example code is available in the Robot project in the test (not FIRST!) SVN repository. Sensors is currently using a protocol where data from all of the sensors is sent in one packet in the format: <Sensorname:value!Sensorname:value!Sensorname:value!>. The exclamation points are used to separate the various sensors. The code is sent out as bytes from the Arduino, and is converted to UTF-8 (with UNIX line endings) by the robot. Software is currently working on parsing the data and sending it to the robot's functions (although it has already gotten robot commands sent from the Arduino to move the motors on the test board).