Guest User

Untitled

a guest
Mar 24th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. #pragma config(Sensor, dgtl1, rightouch, sensorTouch)
  2. #pragma config(Sensor, dgtl2, lefttouch, sensorTouch)
  3. #pragma config(Motor, port2, rightMotor, tmotorServoContinuousRotation, openLoop, reversed)
  4.  
  5. task main()
  6. {
  7. while (1==1)
  8. {
  9. if(SensorValue [rightouch]==1)
  10. {
  11. motor[rightMotor]= 40;
  12. }
  13. else if (SensorValue [lefttouch]==1)
  14. {
  15. motor[rightMotor] = -40;
  16. }
  17. else
  18. {
  19. motor[rightMotor] = 0;
  20. }
  21. }
  22. }
Add Comment
Please, Sign In to add comment