View Single Post
  #6   Spotlight this post!  
Unread 06-03-2007, 17:48
mluckham's Avatar
mluckham mluckham is offline
Registered User
FRC #0758 (Sky Robotics)
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2006
Location: Ontario, Canada
Posts: 116
mluckham will become famous soon enoughmluckham will become famous soon enough
Re: RS 232 and Dashboard

Or maybe you are looking for hints on how to get started coding?

First, capture some actual data into a file to see what it looks like. To do this:

- connect the OI Dashboard port to your computer, and set up the serial port to 115200 baud/etc as instructed in the Dashboard Specification.
- run the Dashboard Viewer program and make sure you are getting data from the robot. Stop the Dashboard Viewer.
- capture or copy whatever is coming into the computer serial port to a file. This will be "binary data" not human-readable (yet).
- fiddle around with your robot controls, to make sure PWM changes/etc are transmitted to the OI in Dashboard data packets
- stop the capture after a 30 seconds or so - you should have lots of data to look at

Find a utility containing a hex viewer such as Winhex or FileZilla. This will show you the binary data, expressed as "hexadecimal" equivalent characters. Using these, compare the data in the file with the Dashboard Specification.

Armed with this information, you can start writing some C or Visual Basic code on your computer. The code will open the serial port and read the live incoming Dashboard data stream from it. I suggest you start by opening an output disk file and copying the data to it. This will prove you have valid data (you can look at the file with the hex viewer).

Now you can start adding recognizer code to your program, looking for the start-of-packet bytes (FF, FF), then copying the remaining 24 bytes of the data packet frame into a data structure in memory. Once you have it there, it should be fairly easy to pick out the fields you are interested in (the PWM values, for example) and use them for the kind of output you would like from your program.