Guest User

Untitled

a guest
Oct 22nd, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. #pragma config(I2C_Usage, I2C1, i2cSensors)
  2. #pragma config(Sensor, dgtl6, touchSensor1, sensorTouch)
  3. #pragma config(Sensor, dgtl7, touchSensor2, sensorTouch)
  4. #pragma config(Motor, port2, blue, tmotorVex393_MC29, openLoop, reversed, driveRight, encoderPort, I2C_1)
  5. //---------------------------------------------------------------------------------------------------------------------------------
  6. task main()
  7. {
  8. //Loop Forever
  9. while(1 == 1)
  10. {
  11.  
  12. if(SensorValue(touchSensor1) == 1 )
  13. {
  14. motor[blue]= 40;
  15. }
  16. else if(SensorValue(touchSensor2) == 1)
  17. {
  18. motor[blue]= -40;
  19. }
  20.  
  21. else
  22. {
  23. motor[blue] = 0;
  24. }
  25. }
  26. }
Add Comment
Please, Sign In to add comment