Advertisement
Guest User

5203R Worlds

a guest
Apr 18th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.55 KB | None | 0 0
  1.  
  2. #include "robot-config.h"
  3. #include <cmath>
  4.  
  5. vex::competition Competition;
  6.  
  7. void driveforward(int inches, bool speed){
  8.  
  9. bool autonomous_running = true;
  10.  
  11. int mastermotorpower;
  12. int slavemotorpower;
  13. FrontLeftMotor.resetRotation();
  14. FrontRightMotor.resetRotation();
  15. float Kp1 = 0.85;
  16. float Kp2 = 0.35;
  17.  
  18. if (speed == true){
  19.  
  20. while (autonomous_running == true && std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg)) < inches * 28){
  21.  
  22.  
  23. mastermotorpower = ((inches*28) - std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))) * Kp1;
  24.  
  25. if (mastermotorpower > 170){
  26.  
  27. mastermotorpower = 170;
  28.  
  29. } else if (mastermotorpower < 50){
  30.  
  31. mastermotorpower = 50;
  32.  
  33. }
  34.  
  35. slavemotorpower = mastermotorpower + ((std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg)) - std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))));
  36.  
  37.  
  38. FrontLeftMotor.spin(vex::directionType::fwd,mastermotorpower, vex::velocityUnits::rpm);
  39. FrontRightMotor.spin(vex::directionType::fwd,slavemotorpower, vex::velocityUnits::rpm);
  40. BackLeftMotor.spin(vex::directionType::fwd,mastermotorpower, vex::velocityUnits::rpm);
  41. BackRightMotor.spin(vex::directionType::fwd,slavemotorpower, vex::velocityUnits::rpm);
  42.  
  43. vex::task::sleep(5);
  44.  
  45. }
  46.  
  47. FrontLeftMotor.stop(vex::brakeType::brake);
  48. FrontRightMotor.stop(vex::brakeType::brake);
  49. BackLeftMotor.stop(vex::brakeType::brake);
  50. BackRightMotor.stop(vex::brakeType::brake);
  51.  
  52. } else {
  53.  
  54. while(autonomous_running == true && std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))< inches * 28){
  55.  
  56. mastermotorpower = ((inches*28) - std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg)))* Kp2;
  57.  
  58. if (mastermotorpower > 100){
  59.  
  60. mastermotorpower = 100;
  61.  
  62. } else if (mastermotorpower < 30){
  63.  
  64. mastermotorpower = 30;
  65.  
  66. }
  67.  
  68. slavemotorpower = mastermotorpower + ((std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))- std::abs(FrontRightMotor.rotation(vex::rotationUnits::deg))));
  69.  
  70. FrontLeftMotor.spin(vex::directionType::fwd,mastermotorpower, vex::velocityUnits::rpm);
  71. BackLeftMotor.spin(vex::directionType::fwd,mastermotorpower, vex::velocityUnits::rpm);
  72. FrontRightMotor.spin(vex::directionType::fwd,slavemotorpower, vex::velocityUnits::rpm);
  73. BackRightMotor.spin(vex::directionType::fwd,slavemotorpower, vex::velocityUnits::rpm);
  74.  
  75. vex::task::sleep(5);
  76.  
  77. }
  78.  
  79. FrontLeftMotor.stop(vex::brakeType::coast);
  80. BackLeftMotor.stop(vex::brakeType::coast);
  81. FrontRightMotor.stop(vex::brakeType::coast);
  82. BackRightMotor.stop(vex::brakeType::coast);
  83.  
  84. }
  85. }
  86.  
  87.  
  88.  
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95. void drivebackwards(int inches, bool speed){
  96.  
  97. bool autonomous_running = true;
  98.  
  99. int mastermotorpower;
  100. int slavemotorpower;
  101. FrontLeftMotor.resetRotation();
  102. FrontRightMotor.resetRotation();
  103. float Kp1 = 0.65;
  104. float Kp2 = 0.4;
  105.  
  106. if (speed == true){
  107.  
  108. while (autonomous_running == true && std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg)) < inches * 28){
  109.  
  110.  
  111. mastermotorpower = ((inches*28) - std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))) * Kp1;
  112.  
  113. if (mastermotorpower > 150){
  114.  
  115. mastermotorpower = 150;
  116.  
  117. } else if (mastermotorpower < 50){
  118.  
  119. mastermotorpower = 50;
  120.  
  121. }
  122.  
  123. slavemotorpower = mastermotorpower + ((std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg)) - std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))));
  124.  
  125.  
  126. FrontLeftMotor.spin(vex::directionType::fwd,mastermotorpower * -1, vex::velocityUnits::rpm);
  127. FrontRightMotor.spin(vex::directionType::fwd,slavemotorpower * -1, vex::velocityUnits::rpm);
  128. BackLeftMotor.spin(vex::directionType::fwd,mastermotorpower * -1, vex::velocityUnits::rpm);
  129. BackRightMotor.spin(vex::directionType::fwd,slavemotorpower * -1, vex::velocityUnits::rpm);
  130.  
  131. vex::task::sleep(5);
  132.  
  133. }
  134.  
  135. FrontLeftMotor.stop(vex::brakeType::brake);
  136. FrontRightMotor.stop(vex::brakeType::brake);
  137. BackLeftMotor.stop(vex::brakeType::brake);
  138. BackRightMotor.stop(vex::brakeType::brake);
  139.  
  140. vex::task::sleep(25);
  141.  
  142. FrontLeftMotor.stop(vex::brakeType::coast);
  143. BackLeftMotor.stop(vex::brakeType::coast);
  144. FrontRightMotor.stop(vex::brakeType::coast);
  145. BackRightMotor.stop(vex::brakeType::coast);
  146.  
  147. } else {
  148.  
  149. while(autonomous_running == true && std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))< inches * 28){
  150.  
  151. mastermotorpower = ((inches*28) - std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg)))* Kp2;
  152.  
  153. if (mastermotorpower > 100){
  154.  
  155. mastermotorpower = 100;
  156.  
  157. } else if (mastermotorpower < 30){
  158.  
  159. mastermotorpower = 30;
  160.  
  161. }
  162.  
  163. slavemotorpower = mastermotorpower + ((std::abs(FrontLeftMotor.rotation(vex::rotationUnits::deg))- std::abs(FrontRightMotor.rotation(vex::rotationUnits::deg))));
  164.  
  165. FrontLeftMotor.spin(vex::directionType::fwd,mastermotorpower * -1, vex::velocityUnits::rpm);
  166. BackLeftMotor.spin(vex::directionType::fwd,mastermotorpower * -1, vex::velocityUnits::rpm);
  167. FrontRightMotor.spin(vex::directionType::fwd,slavemotorpower * -1, vex::velocityUnits::rpm);
  168. BackRightMotor.spin(vex::directionType::fwd,slavemotorpower * -1, vex::velocityUnits::rpm);
  169.  
  170. vex::task::sleep(5);
  171.  
  172. }
  173.  
  174. FrontLeftMotor.stop(vex::brakeType::brake);
  175. BackLeftMotor.stop(vex::brakeType::brake);
  176. FrontRightMotor.stop(vex::brakeType::brake);
  177. BackRightMotor.stop(vex::brakeType::brake);
  178.  
  179. vex::task::sleep(25);
  180.  
  181. FrontLeftMotor.stop(vex::brakeType::coast);
  182. BackLeftMotor.stop(vex::brakeType::coast);
  183. FrontRightMotor.stop(vex::brakeType::coast);
  184. BackRightMotor.stop(vex::brakeType::coast);
  185.  
  186. }
  187. }
  188.  
  189.  
  190.  
  191. void turnleft(float turn){
  192.  
  193. bool autonomous_running = true;
  194.  
  195. int turn_power;
  196. int error;
  197. float Kp1 = 0.65;
  198. double encoder_turning_proportional = 3.2;
  199.  
  200. TrackingWheel.resetRotation();
  201.  
  202. while (autonomous_running == true && std::abs(TrackingWheel.rotation(vex::rotationUnits::deg)) / encoder_turning_proportional < turn){
  203.  
  204. vex::task::sleep(5);
  205.  
  206. error = turn - std::abs((TrackingWheel.rotation(vex::rotationUnits::deg) / encoder_turning_proportional));
  207.  
  208. turn_power = (error * Kp1) * 2;
  209.  
  210. if (turn_power > 110){
  211.  
  212. turn_power = 110;
  213. }
  214.  
  215. else if (turn_power < 30){
  216.  
  217. turn_power = 20;
  218.  
  219. }
  220.  
  221. FrontLeftMotor.spin(vex::directionType::fwd,turn_power * -1,vex::velocityUnits::rpm);
  222. BackLeftMotor.spin(vex::directionType::fwd,turn_power * -1,vex::velocityUnits::rpm);
  223. FrontRightMotor.spin(vex::directionType::fwd,turn_power ,vex::velocityUnits::rpm);
  224. BackRightMotor.spin(vex::directionType::fwd,turn_power ,vex::velocityUnits::rpm);
  225.  
  226. }
  227.  
  228. FrontLeftMotor.stop(vex::brakeType::brake);
  229. BackLeftMotor.stop(vex::brakeType::brake);
  230. FrontRightMotor.stop(vex::brakeType::brake);
  231. BackRightMotor.stop(vex::brakeType::brake);
  232.  
  233. vex::task::sleep(20);
  234.  
  235. FrontLeftMotor.stop(vex::brakeType::coast);
  236. BackLeftMotor.stop(vex::brakeType::coast);
  237. FrontRightMotor.stop(vex::brakeType::coast);
  238. BackRightMotor.stop(vex::brakeType::coast);
  239. }
  240.  
  241.  
  242.  
  243.  
  244. void turnright(float turn){
  245.  
  246. bool autonomous_running = true;
  247.  
  248. int turn_power;
  249. int error;
  250. float Kp1 = 0.55;
  251. double encoder_turning_proportional = 3.2;
  252.  
  253. TrackingWheel.resetRotation();
  254.  
  255. while (autonomous_running == true && std::abs(TrackingWheel.rotation(vex::rotationUnits::deg)) < turn * encoder_turning_proportional){
  256.  
  257. vex::task::sleep(5);
  258.  
  259. error = turn - std::abs((TrackingWheel.rotation(vex::rotationUnits::deg) / encoder_turning_proportional));
  260.  
  261. turn_power = (error * Kp1) * 2;
  262.  
  263. if (turn_power > 100){
  264.  
  265. turn_power = 100;
  266. }
  267.  
  268. else if (turn_power < 20){
  269.  
  270. turn_power = 20;
  271.  
  272. }
  273.  
  274. FrontLeftMotor.spin(vex::directionType::fwd,turn_power,vex::velocityUnits::rpm);
  275. BackLeftMotor.spin(vex::directionType::fwd,turn_power,vex::velocityUnits::rpm);
  276. FrontRightMotor.spin(vex::directionType::fwd,turn_power * -1,vex::velocityUnits::rpm);
  277. BackRightMotor.spin(vex::directionType::fwd,turn_power * -1,vex::velocityUnits::rpm);
  278.  
  279. }
  280. FrontRightMotor.stop(vex::brakeType::brake);
  281. BackLeftMotor.stop(vex::brakeType::brake);
  282. FrontRightMotor.stop(vex::brakeType::brake);
  283. BackRightMotor.stop(vex::brakeType::brake);
  284.  
  285. vex::task::sleep(20);
  286.  
  287. BackLeftMotor.stop(vex::brakeType::coast);
  288. BackRightMotor.stop(vex::brakeType::coast);
  289. FrontRightMotor.stop(vex::brakeType::coast);
  290. BackRightMotor.stop(vex::brakeType::coast);
  291. }
  292.  
  293.  
  294.  
  295.  
  296.  
  297. void pre_auton( void ) {
  298.  
  299. FrontLeftMotor.resetRotation();
  300. FrontRightMotor.resetRotation();
  301. BackLeftMotor.resetRotation();
  302. BackRightMotor.resetRotation();
  303.  
  304. }
  305.  
  306. void autonomous( void ) {
  307.  
  308. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  309.  
  310. BallIntake.spin(directionType::rev, 100, velocityUnits::pct);
  311.  
  312. vex::task::sleep(25);
  313.  
  314. FlyWheel.spin(directionType::fwd, 100, velocityUnits::pct);
  315.  
  316. vex::task::sleep(25);
  317.  
  318. driveforward(44,true);
  319.  
  320. vex::task::sleep(250);
  321.  
  322. drivebackwards(3,true);
  323.  
  324. vex::task::sleep(250);
  325.  
  326. turnright(9);
  327.  
  328. vex::task::sleep(100);
  329.  
  330. BallIntake.stop(brakeType::coast);
  331.  
  332. drivebackwards(40,true);
  333.  
  334. vex::task::sleep(25);
  335.  
  336. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  337.  
  338. turnleft(56);
  339.  
  340. vex::task::sleep(100);
  341.  
  342. driveforward(7,false);
  343.  
  344.  
  345. FrontLeftMotor.stop(vex::brakeType::hold);
  346. FrontRightMotor.stop(vex::brakeType::hold);
  347. BackLeftMotor.stop(vex::brakeType::hold);
  348. BackRightMotor.stop(vex::brakeType::hold);
  349.  
  350. BallIntake.startRotateFor(-1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  351. Indexer.rotateFor(1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  352.  
  353. Flipper.startRotateTo(20,vex::rotationUnits::deg,90,vex::velocityUnits::pct);
  354. BallIntake.startRotateFor(-1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  355. Indexer.startRotateFor(1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  356.  
  357. vex::task::sleep(5);
  358.  
  359. Indexer.startRotateFor(800,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  360. BallIntake.rotateFor(-800,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  361.  
  362. vex::task::sleep(15);
  363.  
  364. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  365.  
  366. FrontLeftMotor.stop(vex::brakeType::coast);
  367. FrontRightMotor.stop(vex::brakeType::coast);
  368. BackLeftMotor.stop(vex::brakeType::coast);
  369. BackRightMotor.stop(vex::brakeType::coast);
  370.  
  371.  
  372. driveforward(3,false);
  373.  
  374. Flipper.rotateTo(-275,vex::rotationUnits::deg,45,vex::velocityUnits::pct);
  375.  
  376. BallIntake.spin(directionType::rev, 100, velocityUnits::pct);
  377.  
  378. drivebackwards(8,true);
  379.  
  380. vex::task::sleep(400);
  381.  
  382. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  383.  
  384. vex::task::sleep(150);
  385.  
  386. drivebackwards(2,true);
  387.  
  388. vex::task::sleep(300);
  389.  
  390. turnleft(47);
  391.  
  392. vex::task::sleep(300);
  393.  
  394. drivebackwards(5,true);
  395.  
  396. vex::task::sleep(300);
  397.  
  398.  
  399. FrontLeftMotor.stop(vex::brakeType::hold);
  400. FrontRightMotor.stop(vex::brakeType::hold);
  401. BackLeftMotor.stop(vex::brakeType::hold);
  402. BackRightMotor.stop(vex::brakeType::hold);
  403.  
  404. BallIntake.startRotateFor(-1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  405. Indexer.rotateFor(1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  406.  
  407. Flipper.startRotateTo(20,vex::rotationUnits::deg,90,vex::velocityUnits::pct);
  408. BallIntake.startRotateFor(-1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  409. Indexer.startRotateFor(1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  410.  
  411. vex::task::sleep(5);
  412.  
  413. Indexer.startRotateFor(800,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  414. BallIntake.rotateFor(-800,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  415.  
  416. vex::task::sleep(15);
  417.  
  418. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  419.  
  420. FrontLeftMotor.stop(vex::brakeType::coast);
  421. FrontRightMotor.stop(vex::brakeType::coast);
  422. BackLeftMotor.stop(vex::brakeType::coast);
  423. BackRightMotor.stop(vex::brakeType::coast);
  424.  
  425.  
  426. driveforward(44,true);
  427.  
  428. Flipper.rotateTo(-180,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  429.  
  430. FrontLeftMotor.stop(vex::brakeType::coast);
  431. BackLeftMotor.stop(vex::brakeType::coast);
  432. FrontRightMotor.stop(vex::brakeType::coast);
  433. BackRightMotor.stop(vex::brakeType::coast);
  434.  
  435. }
  436.  
  437. void usercontrol( void ) {
  438.  
  439. int FlyWheelPCT = 100;
  440. int BallIntakePCT = 100;
  441. int IndexerPCT = 100;
  442. int FlipperPCT = 70;
  443.  
  444. while (true) {
  445.  
  446. if(Controller1.ButtonUp.pressing()) {
  447. FrontLeftMotor.stop(vex::brakeType::hold);
  448. FrontRightMotor.stop(vex::brakeType::hold);
  449. BackLeftMotor.stop(vex::brakeType::hold);
  450. BackRightMotor.stop(vex::brakeType::hold);
  451. }
  452. else if(Controller1.ButtonDown.pressing()) {
  453. FrontLeftMotor.stop(vex::brakeType::coast);
  454. FrontRightMotor.stop(vex::brakeType::coast);
  455. BackLeftMotor.stop(vex::brakeType::coast);
  456. BackRightMotor.stop(vex::brakeType::coast);
  457. }
  458. else{
  459. FrontLeftMotor.spin(directionType::fwd, (Controller1.Axis3.value() + Controller1.Axis4.value()), velocityUnits::pct); //(Axis3+Axis4)/1.5;
  460. FrontRightMotor.spin(directionType::fwd, (Controller1.Axis3.value() - Controller1.Axis4.value()), velocityUnits::pct);//(Axis3-Axis4)/1.5;
  461. BackLeftMotor.spin(directionType::fwd, (Controller1.Axis3.value() + Controller1.Axis4.value()), velocityUnits::pct); //(Axis3+Axis4)/1.5;
  462. BackRightMotor.spin(directionType::fwd, (Controller1.Axis3.value() - Controller1.Axis4.value()), velocityUnits::pct);//(Axis3-Axis4)/1.5;
  463. }
  464.  
  465. if(Controller1.ButtonR1.pressing()) {
  466. BallIntake.spin(directionType::fwd, BallIntakePCT, velocityUnits::pct);
  467. }
  468. else if(Controller1.ButtonR2.pressing()) {
  469. BallIntake.spin(directionType::rev, BallIntakePCT, velocityUnits::pct);
  470. }
  471.  
  472. else if(Controller1.ButtonL2.pressing()) {
  473.  
  474. FrontLeftMotor.stop(vex::brakeType::hold);
  475. FrontRightMotor.stop(vex::brakeType::hold);
  476. BackLeftMotor.stop(vex::brakeType::hold);
  477. BackRightMotor.stop(vex::brakeType::hold);
  478.  
  479. BallIntake.startRotateFor(-1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  480. Indexer.rotateFor(1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  481.  
  482. Flipper.startRotateTo(20,vex::rotationUnits::deg,90,vex::velocityUnits::pct);
  483. BallIntake.startRotateFor(-1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  484. Indexer.startRotateFor(1500,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  485.  
  486. vex::task::sleep(5);
  487.  
  488. Indexer.startRotateFor(800,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  489. BallIntake.rotateFor(-800,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  490.  
  491. vex::task::sleep(15);
  492.  
  493. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  494.  
  495. FrontLeftMotor.stop(vex::brakeType::coast);
  496. FrontRightMotor.stop(vex::brakeType::coast);
  497. BackLeftMotor.stop(vex::brakeType::coast);
  498. BackRightMotor.stop(vex::brakeType::coast);
  499.  
  500. }
  501.  
  502. else if(Controller1.ButtonY.pressing()) {
  503. Indexer.startRotateFor(160,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  504. BallIntake.startRotateFor(-160,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  505. Flipper.rotateTo(-50,vex::rotationUnits::deg,85,vex::velocityUnits::pct);
  506.  
  507. vex::task::sleep(50);
  508.  
  509. }
  510.  
  511. else if(Controller1.ButtonLeft.pressing()) {
  512. Flipper.rotateTo(15,vex::rotationUnits::deg,90,vex::velocityUnits::pct);
  513.  
  514. Indexer.startRotateFor(1100,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  515. BallIntake.rotateFor(-1100,vex::rotationUnits::deg,100,vex::velocityUnits::pct);
  516.  
  517. Flipper.rotateTo(50,vex::rotationUnits::deg,90,vex::velocityUnits::pct);
  518.  
  519. vex::task::sleep(50);
  520.  
  521. }
  522.  
  523. else {
  524. BallIntake.stop(brakeType::brake);
  525. }
  526.  
  527. if(Controller1.ButtonL1.pressing()) {
  528. FlyWheel.spin(directionType::fwd, FlyWheelPCT, velocityUnits::pct);
  529. }
  530.  
  531. else {
  532.  
  533.  
  534. FlyWheel.stop(brakeType::coast);
  535. }
  536.  
  537.  
  538. if(Controller1.ButtonX.pressing()) {
  539. Indexer.spin(directionType::fwd, IndexerPCT, velocityUnits::pct);
  540. BallIntake.spin(directionType::rev, BallIntakePCT, velocityUnits::pct);
  541. }
  542.  
  543. else {
  544. Indexer.stop(brakeType::coast);
  545. }
  546.  
  547. if(Controller1.ButtonA.pressing()) {
  548.  
  549. Flipper.spin(directionType::rev, FlipperPCT, velocityUnits::pct);
  550. }
  551.  
  552. else if(Controller1.ButtonB.pressing()) {
  553.  
  554. Flipper.spin(directionType::fwd, FlipperPCT, velocityUnits::pct);
  555. }
  556.  
  557.  
  558.  
  559. else {
  560. Flipper.stop(brakeType::hold);
  561. }
  562.  
  563. task::sleep(20);
  564. }
  565. }
  566.  
  567.  
  568. int main() {
  569.  
  570.  
  571. pre_auton();
  572.  
  573.  
  574. Competition.autonomous( autonomous );
  575. Competition.drivercontrol( usercontrol );
  576.  
  577.  
  578. while(1) {
  579. vex::task::sleep(100);//Sleep the task for a short amount of time to prevent wasted resources.
  580. }
  581.  
  582. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement