HTML

[PROJECT] drillbot.c

Dec 19th, 2017
339
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.15 KB | None | 0 0
  1. #pragma config(Motor,  port2,           track2,        tmotorVex393_MC29, openLoop)
  2. #pragma config(Motor,  port3,           track1,        tmotorVex393_MC29, openLoop)
  3. #pragma config(Motor,  port8,           pivot1,        tmotorVex393_MC29, openLoop)
  4. #pragma config(Motor,  port9,           drill1,        tmotorServoStandard, openLoop)
  5. //*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
  6.  
  7. task main()
  8. {
  9.     // the head rotates the arm outward about 90 degrees to meet the object
  10.     startMotor(pivot1,-15);
  11.     wait(1);
  12.     stopMotor(pivot1);
  13.     // track moves forward a couple inches
  14.   startMotor(track1,17.5);
  15.     startMotor(track2,17.5);
  16.     wait(1);
  17.     stopMotor(track1);
  18.     stopMotor(track2);
  19.     // the drill end of the arm turns for a few seconds to drill the object
  20.     startMotor(drill1,100);
  21.     wait(3);
  22.     stopMotor(drill1);
  23.     // track moves backward to it's original position to deliver part
  24.     startMotor(track1,-17.5);
  25.     startMotor(track2,-17.5);
  26.     wait(1);
  27.     stopMotor(track1);
  28.     stopMotor(track2);
  29.     // the head rotates the arm back to it's original position, out of the way
  30.     startMotor(pivot1,15);
  31.     wait(1);
  32.     stopMotor(pivot1);
  33. }
Advertisement
Add Comment
Please, Sign In to add comment