Quote:
|
Originally Posted by katkana
So... onto business. Here's the entire code:
|
There's another problem. You're not accounting for all the the counter states, which will cause your 'bot to not function the way you think it will. As an example of what I'm referring to, have a look at the code below:
Code:
else if(counter > 120 && counter < 240) /* if 2-4 seconds have passed */
{
pwm01=155; /* right motor forward */
pwm02=27; /* left motor backward */
pwm03=pwm04=127; /*arm motors off */
}
else if(counter > 240 && counter < 360) /* if 4-6 seconds have passed */
{
pwm01=pwm02=pwm03=127; /* stop */
pwm04=200; /* upper arm joint raises */
}
What happens when counter == 240? I think you should be using a >= or <= in there someplace (This bug bites me all the time <grin>).
-Kevin