Quote:
|
Originally Posted by Meandmyself
the wierdest thing is happening. When I do this;
Code:
/*way up at the beginning of the file...*/
char counter = 0;
/*in process_data_from_master_uP*/
gyroin = get_analog_value(rc_ana_in_01);
if (counter > 40) {
printf("%d, %d \n",gyroin,get_analog_value(rc_ana_in_01));
counter=0;
}
counter++;
printf prints out nothing. But this:
Code:
printf("%d, %d \n",gyroin,get_analog_value(rc_ana_in_01));
works fine. What's going on here?
BTW, this is all happening in the context of a larger problem that is I can't get the Gyro from last year to send values to the Edubot. When it does print, it says 0,0 no matter what.
It also has never printed the initialization message in user_initialization(). What's up with that?
|
Have you been running your code in the simulator on the PC? If you forget to clear the constant that lets you run on the PC simulator then you get flakey printf results. Check under the project properties for the compiler for the constant. The reason it works flakey is that with that constant set the code doesn't wait for the last character to get sent before sending the next.
Hope this helps!