Changes between Version 2 and Version 3 of UsingSerialPorts
- Timestamp:
- Apr 22, 2015, 7:43:51 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
UsingSerialPorts
v2 v3 6 6 || TTL Serial (MXP) || || 7 7 8 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:8 The Interface team (Sensors-Software Communication Squad) (Nathan and Alex, with help from Mr. Albert) have gotten TTL communication working with an Arduino at 57600 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: 9 9 <Sensorname:value!Sensorname:value!Sensorname:value!>. 10 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). 10 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. 11 12 The main class for serial communications is (aptly named) SerialCommunication.java. This class's purpose is to receive the latest complete serial message via raw bytes, convert them to UTF-8, and subsequently parse it via an array, splitting the tags (sensor name) and the values (the numbers returned by the sensors) into separate arrays that are then returned, and sent into the internals of the robot. ALEX: ADD STUFF ABOUT THE STUFF THAT YOU DID