View Single Post
  #15   Spotlight this post!  
Unread 14-02-2004, 23:05
Gene F's Avatar
Gene F Gene F is offline
FIRST Fanatic
AKA: Gene Falendysz
#0343 (Metal in Motion)
Team Role: Engineer
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Oconee County, SC
Posts: 218
Gene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to beholdGene F is a splendid one to behold
Send a message via AIM to Gene F
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:

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!
__________________
- Gene Falendysz