View Single Post
  #4   Spotlight this post!  
Unread 13-02-2004, 09:26
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,801
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
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.