Quote:
|
Originally Posted by rbayer
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?
|
Missing a = is an easy thing to do. It's one of those powerful, useful things that C/C++ lets you do, but isn't what you want most of the time.
