View Single Post
  #12   Spotlight this post!  
Unread 16-02-2004, 14:57
rbayer's Avatar Unsung FIRST Hero
Happy Birthday! rbayer rbayer is offline
Blood, Sweat, and Code
no team (Teamless Orphan)
 
Join Date: Mar 2002
Rookie Year: 2001
Location: Minnetonka, MN
Posts: 1,087
rbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of lightrbayer is a glorious beacon of light
Send a message via AIM to rbayer
Re: Odd counter problems

A few things I saw after glancing at it:
Code:
if (armcounter = 15) //will raise arm.
   pwm06=0;
else 
   armcounter++;
   pwm06=255;
sould be
Code:
if (armcounter == 15) //will raise arm.
   pwm06=0;
else {
   armcounter++;
   pwm06=255; 
}
It is VERY rare that you'll actually want to use a single = in an if, so watch out for that, and also be careful with your curly braces.

That said, I believe the code in its original form should have printf'd 15 over and over and over. Was it doing that, or just not printing anything?
__________________
New C-based RoboEmu2 (code simulator) available at: http://www.robbayer.com/software.php