View Single Post
  #2   Spotlight this post!  
Unread 26-02-2014, 00:53
Joe Hershberger Joe Hershberger is offline
National Instruments
AKA: jhersh
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 1997
Location: Austin, TX
Posts: 148
Joe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to allJoe Hershberger is a name known to all
Re: Trouble Printing to NetConsole

Quote:
Originally Posted by SenorPotter View Post
I've been having an interesting issue with printing data to the NetConsole using the standard cout<< function. When printing just one or two different reads, like this (from the end of our OperatorControl) then it works fine:

Code:
if (h%24 == 0){
	*G = int(gyro->GetAngle());
	cout<<("Gyroscope Angle: " && *G && "\n");
}
h++;
Wait(0.03);	// wait for a motor update time
But whenever I try to print a few more (I'll attach the second example, it's a bit cumbersome to look at in this format), I get an error from NetConsole about a kernel issue, the cRio crashes, and we have to reboot the robot and take away the cout's to make it work again.
The code's been compiling just fine otherwise, but I can't imagine why this wouldn't work. Would the cRio somehow be overloaded by the few extra prints? Any help is appreciated!
I've always used printf() with no issues. It is surprising that you are having this issue, but printf() could be a workaround.
Reply With Quote