Thank you for your help, it worked great.
Team 1611
Quote:
|
Originally Posted by charrisTTI
The last example will solve the compile problem, but now I think you need to fix your logic.
for ( step1 = 0, step2 = 255 ; step1 < 127 && step2 > 127 ; step1 += 5, step2 += 5 )
If you want the motors to ramp from stopped to maximum speed in steps of 5, the statement would need to change to:
for ( step1 = 127, step2 = 127 ; step1 < 255 && step2 > 0 ; step1 += 5, step2 -= 5 )
You also need to consider that the system (the robot and motors) will not respond instantaneously to changes in pwm values. There needs to be some kind of delay between each new set values that are sent to the motors.
|