Robotc 4-wheel Joystick Test (Drive System)


SUBMITTED BY: Guest

DATE: Dec. 24, 2013, 11:36 p.m.

FORMAT: Text only

SIZE: 933 Bytes

HITS: 1201

  1. #include "JoystickDriver.c"
  2. task main()
  3. {
  4. while(true)
  5. {
  6. getJoystickSettings(joystick);
  7. if(joystick.joy1_y1 < -100){
  8. motor(motorD)= 60;
  9. motor(motorE)= -60;
  10. motor(motorF)= 60;
  11. motor(motorG)= -60;
  12. }
  13. else
  14. {
  15. if(joystick.joy1_y1 > 100){
  16. motor(motorD)= -60;
  17. motor(motorE)= 60;
  18. motor(motorF)= -60;
  19. motor(motorG)= 60;
  20. }
  21. else{
  22. if(joystick.joy1_x1 < -100){
  23. motor(motorD) = 60;
  24. motor(motorE) = 60;
  25. motor(motorF) = 60;
  26. motor(motorG) = 60;
  27. }
  28. else
  29. {if(joystick.joy1_x1 > 100){
  30. motor(motorD) = -60;
  31. motor(motorE) = -60;
  32. motor(motorF) = -60;
  33. motor(motorG) = -60;
  34. }
  35. else{
  36. motor(motorD)= 0;
  37. motor(motorE)= 0;
  38. motor(motorF)= 0;
  39. motor(motorG)= 0;
  40. }
  41. }
  42. }
  43. }
  44. }
  45. }

comments powered by Disqus