Log in

View Full Version : A Portable Serial Data-logger for the FRC Robot Controller


PhilBot
12-01-2008, 23:24
I just finshed building a cool project to help us debug our code during Hybrid and teleop mode.

I wanted to be able to record dagnostic data from the RC and I didn't want to use wireless because I thought it would also be helpfull during competitions.

I got a cool serial datalogger from Spark Fun and adapted it to the RC Serial Port 2. It only took a single 4 wire cable and simple code modification... Only a couple of hours work.:yikes:

If you want to get dynamic driving data from your bot... check out the white paper I just wrote...

http://www.chiefdelphi.com/media/papers/2065

Tim Arnold
13-01-2008, 00:04
Wow, this is very cool! The writeup makes it look quite simple as you say, but my main question is if you know if the serial communications for this are possible with EasyC.

mluckham
13-01-2008, 00:06
I asked the question today, whether Easy/C printf output can be redirected to the 2nd serial port.

I looked at the WPILIB documentation, it is dead simple to output to the second serial port - but there is no printf - so you will have to supply your own.

PhilBot
13-01-2008, 10:19
I asked the question today, whether Easy/C printf output can be redirected to the 2nd serial port.

I looked at the WPILIB documentation, it is dead simple to output to the second serial port - but there is no printf - so you will have to supply your own.

I've not used Easy C, but if you can output to the second serial port, then maybe you can use sprintf()

sprintf is just like printf, except that instead of sending text to the "console" it writes the resultant text to a string variable.

So if you declare a char array:

char Buffer[128] ;

And then write your data to that using sprintf..

sprintf(Buffer, "%d,%d,%d\r\n", test1, test2, test3);

Then you can send Buffer to the second serial port.

You need to make sure that Buffer is big enough for ANY single string you want to write out.

Phil.

Phalanx
13-01-2008, 10:26
This is excellent work!!!

I've had that very same idea for quite sometime, but have never pursued it.
You've beat me to it.!!

Nice job, well done.