Advertisement
andreahmed

Untitled

May 6th, 2017
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. if(leftMotorSpeed > 0 && rightMotorSpeed > 0 )
  2. {
  3. // set motor speeds using the two motor speed variables above
  4. set_motors_positive(leftMotorSpeed, rightMotorSpeed);
  5. }
  6. else if ( leftMotorSpeed > 0 && rightMotorSpeed < 0 )
  7. {
  8. set_motors_negative(leftMotorSpeed, rightMotorSpeed);
  9.  
  10. }
  11.  
  12.  
  13. else if ( leftMotorSpeed < 0 && rightMotorSpeed > 0 )
  14. {
  15. set_motors_negative(leftMotorSpeed, rightMotorSpeed);
  16.  
  17. }
  18.  
  19. else if ( leftMotorSpeed < 0 && rightMotorSpeed < 0 )
  20. {
  21. set_motors_negative(leftMotorSpeed, rightMotorSpeed);
  22.  
  23. }
  24.  
  25. else
  26. {
  27. set_motors_positive(leftMotorSpeed, rightMotorSpeed);
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement