|
Re: printf isn't printf-ing. Help!
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:
|
counter never gets higher than 1 in your version, and you have a problem in your printf as well.
Do this instead.
Code:
/* all in process_data_from_master_uP*/
static char counter = 0;
gyroin = get_analog_value(rc_ana_in_01);
if (counter > 40) {
printf("%d, %d \n", (int)gyroin, (int)get_analog_value(rc_ana_in_01));
counter=0;
}
counter++;
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Last edited by Mark McLeod : 13-02-2004 at 09:39.
|