View Single Post
  #2   Spotlight this post!  
Unread 25-02-2007, 20:07
Racer26 Racer26 is offline
Registered User
no team
Team Role: Alumni
 
Join Date: Apr 2003
Rookie Year: 2003
Location: Beaverton, ON
Posts: 2,229
Racer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond reputeRacer26 has a reputation beyond repute
Re: Trouble with Autonomous

I can almost assure you the problem has to do with your equation in the line "int time...." you're generating a float in the middle of it (30/300)= 0.1, which the integer math in the PIC reduces to 0, before continuing with the rest of the math.

As for how to fix it, you could multiply all the numbers involved by say 1000, and divide by 1000 as your last step... or... something.