Quote:
|
Originally Posted by devicenull
Code:
while( i<90)
{
left_side[i]=p1_y;
right_side[i]=p2_y;
}
You forgot i++;, so its just an infinite loop.
|
True, but also, that loop would record the same values about 90 times (+/- 1). Better would be to have the record code in the main program and just do 2 if's (if button and i<90) so that it records what you do. Then in the replay code, use for(i=0, i<90, i++) {...} so that it will loop though it that number of times. This makes changing your code easier and easier to read.
<edit>
Quote:
|
Originally Posted by sciguy125
I'm also not sure if this is legal:
But, I guess if the compiler didn't complain, it's alright.
|
A better way would be "pwm01=pwm02=127;" becuase pwm02 then is 127, afterword, pwm01 would be set equal to pwm02, making pwm01 127. You could check the values with a debugger or have some visual output, but I don't think "pwm01,pwm02=127" does what you think it does, but it isn't the cause of the problem.