Quote:
Originally Posted by SuperBK
Juse use printf and to see the output, open a target console. Right click on the target, select "Target Tools" and "Console". You don't have to be running in debug mode to see the output.
Brian
|
They want to use wifi to retrieve the output, which (using printf) is spat out to the serial on the cRio (which requires a physical connection). You could use a serial/wireless adapter ($100)

.
Or maybe if you write your debugging messages to a file on the cRio, you can retrieve them by ftp-ing to it wirelessly (10.te.am.2, using "root" and no password). You could probably even watch the file grow as if it were real console output, using something like
ftptail.
Here's the code you need to write stuff to files:
Code:
#include <stdio.h>
#include <stdarg.h>
FILE *debugf;
/**
* Use this like you use printf! (e.g. debug("Gyro heading = %f", gyro->GetAngle());).
*/
void debug(char *msg, ...)
{
if (debugf != NULL)
{
char buf[256];
va_list args;
va_start(args, msg);
vsprintf(buf, msg, args);
va_end(args);
fputs(buf, debugf);
fputs("\n", debugf);
}
}
/**
* Put this in IterativeRobot::RobotInit!
*/
void debugInit()
{
if (debugf == NULL)
{
debugf = fopen("debug.txt", "w");
}
}
I haven't tried this! The advantages of writing to files is that it creates significantly less overhead than printfs, but I dunno about overhead caused by ftptail.
