Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(leftMotorSpeed > 0 && rightMotorSpeed > 0 )
- {
- // set motor speeds using the two motor speed variables above
- set_motors_positive(leftMotorSpeed, rightMotorSpeed);
- }
- else if ( leftMotorSpeed > 0 && rightMotorSpeed < 0 )
- {
- set_motors_negative(leftMotorSpeed, rightMotorSpeed);
- }
- else if ( leftMotorSpeed < 0 && rightMotorSpeed > 0 )
- {
- set_motors_negative(leftMotorSpeed, rightMotorSpeed);
- }
- else if ( leftMotorSpeed < 0 && rightMotorSpeed < 0 )
- {
- set_motors_negative(leftMotorSpeed, rightMotorSpeed);
- }
- else
- {
- set_motors_positive(leftMotorSpeed, rightMotorSpeed);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement