Advertisement
Guest User

Lift Issue

a guest
Jan 28th, 2015
253
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #pragma config(I2C_Usage, I2C1, i2cSensors)
  2. #pragma config(Sensor, in1,    gyro,           sensorGyro)
  3. #pragma config(Sensor, in2,    potentiometerLt, sensorPotentiometer)
  4. #pragma config(Sensor, in3,    potentiometerRt, sensorPotentiometer)
  5. #pragma config(Sensor, dgtl1,  claw,           sensorDigitalOut)
  6. #pragma config(Sensor, dgtl3,  platform,       sensorDigitalOut)
  7. #pragma config(Sensor, I2C_1,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign)
  8. #pragma config(Sensor, I2C_2,  ,               sensorQuadEncoderOnI2CPort,    , AutoAssign)
  9. #pragma config(Motor,  port1,           Intake1,       tmotorVex393_HBridge, openLoop, reversed)
  10. #pragma config(Motor,  port2,           RtBackWheel,   tmotorVex393HighSpeed_MC29, openLoop, reversed, encoderPort, I2C_2)
  11. #pragma config(Motor,  port3,           LtDrive,       tmotorVex393HighSpeed_MC29, openLoop)
  12. #pragma config(Motor,  port4,           RtBackLift,    tmotorVex393HighSpeed_MC29, openLoop, reversed)
  13. #pragma config(Motor,  port5,           LtBackLift,    tmotorVex393HighSpeed_MC29, openLoop)
  14. #pragma config(Motor,  port6,           LtBackWheel,   tmotorVex393HighSpeed_MC29, openLoop, encoderPort, I2C_1)
  15. #pragma config(Motor,  port7,           RtDrive,       tmotorVex393HighSpeed_MC29, openLoop, reversed)
  16. #pragma config(Motor,  port8,           LtFrontLift,   tmotorVex393HighSpeed_MC29, openLoop)
  17. #pragma config(Motor,  port9,           RtFrontLift,   tmotorVex393HighSpeed_MC29, openLoop, reversed)
  18. #pragma config(Motor,  port10,          Intake2,       tmotorVex393_HBridge, openLoop)
  19. //*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//
  20.  
  21. #pragma platform(VEX)
  22.  
  23. //Competition Control and Duration Settings
  24. #pragma competitionControl(Competition)
  25. #pragma autonomousDuration(20)
  26. #pragma userControlDuration(120)
  27. #include "Vex_Competition_Includes.c"   //Main competition background code...do not modify!
  28. #define LEFT 1
  29. #define RIGHT -1
  30.  
  31. int buttonToggleState1 = 0;
  32. int buttonPressed1 = 0;
  33. int buttonToggleState2 = 0;
  34. int buttonPressed2 = 0;
  35. int buttonPressed3 = 0;
  36. int buttonPressed4 = 0;
  37. bool RightLower = true;
  38. bool leftHigher = true;
  39. const unsigned int TrueSpeed[128] =
  40. {
  41.     0,  0,  0,  0,  0,  0,  0,  0,  0,  0,
  42.     0, 21, 21, 21, 22, 22, 22, 23, 24, 24,
  43.     25, 25, 25, 25, 26, 27, 27, 28, 28, 28,
  44.     28, 29, 30, 30, 30, 31, 31, 32, 32, 32,
  45.     33, 33, 34, 34, 35, 35, 35, 36, 36, 37,
  46.     37, 37, 37, 38, 38, 39, 39, 39, 40, 40,
  47.     41, 41, 42, 42, 43, 44, 44, 45, 45, 46,
  48.     46, 47, 47, 48, 48, 49, 50, 50, 51, 52,
  49.     52, 53, 54, 55, 56, 57, 57, 58, 59, 60,
  50.     61, 62, 63, 64, 65, 66, 67, 67, 68, 70,
  51.     71, 72, 72, 73, 74, 76, 77, 78, 79, 79,
  52.     80, 81, 83, 84, 84, 86, 86, 87, 87, 88,
  53.     88, 89, 89, 90, 90,127,127,127
  54. };
  55.  
  56. /////////////////////////////////////////////////////////////////////////////////////////
  57. //
  58. //                          Pre-Autonomous Functions
  59. //
  60. // You may want to perform some actions before the competition starts. Do them in the
  61. // following function.
  62. //
  63. /////////////////////////////////////////////////////////////////////////////////////////
  64.  
  65. void fwds(int distance, int speed)
  66. {
  67.     nMotorEncoder[RtBackWheel] = 0;
  68.     nMotorEncoder[LtBackWheel] = 0;
  69.     while(nMotorEncoder[RtBackWheel] < distance && nMotorEncoder[LtBackWheel] > (distance * -1))
  70.     {
  71.         motor[LtDrive] = speed;
  72.         motor[LtBackWheel] = speed;
  73.         motor[RtDrive] = speed;
  74.         motor[RtBackWheel] = speed;
  75.     }
  76.     motor[LtDrive] = 0;
  77.     motor[LtBackWheel] = 0;
  78.     motor[RtDrive] = 0;
  79.     motor[RtBackWheel] = 0;
  80. }
  81.  
  82. void bwds(int distance, int speed)
  83. {
  84.     fwds(distance, -speed);
  85. }
  86.  
  87. void turn(int angle, int speed, int direction)
  88. {
  89.     int gError = SensorValue[gyro];
  90.  
  91.     while(direction * (SensorValue[gyro] - gError) < angle)
  92.     {
  93.         motor[LtBackWheel] = -direction * speed;
  94.         motor[LtDrive] = -direction * speed;
  95.         motor[RtBackWheel] = direction * speed;
  96.         motor[RtDrive] = direction * speed;
  97.     }
  98.  
  99.     motor[LtBackWheel] = 0;
  100.     motor[LtDrive] = 0;
  101.     motor[RtBackWheel] = 0;
  102.     motor[RtDrive] = 0;
  103. }
  104.  
  105. void swing(int angle, int speed, int direction)
  106. {
  107.     if(direction > 0)
  108.     {
  109.         while(direction * SensorValue[in1] < angle)
  110.         {
  111.             motor[LtBackWheel] = 0;
  112.             motor[LtDrive] = 0;
  113.             motor[RtBackWheel] = direction * speed;
  114.             motor[RtDrive] = direction * speed;
  115.         }
  116.     }
  117.     else
  118.     {
  119.         while(direction * SensorValue[in1] < angle)
  120.         {
  121.             motor[LtBackWheel] = -direction * speed;
  122.             motor[LtDrive] = -direction * speed;
  123.             motor[RtBackWheel] = 0;
  124.             motor[RtDrive] = 0;
  125.         }
  126.     }
  127.  
  128.     motor[LtBackWheel] = 0;
  129.     motor[LtDrive] = 0;
  130.     motor[RtBackWheel] = 0;
  131.     motor[RtDrive] = 0;
  132. }
  133. void bwdslft(int distance, int speed)
  134. {
  135.     nMotorEncoder[RtBackWheel] = 0;
  136.     nMotorEncoder[LtBackWheel] = 0;
  137.     while(nMotorEncoder[RtBackWheel] > (distance * -1) && nMotorEncoder[LtBackWheel] < distance)
  138.     {
  139.         motor[LtDrive] = -speed;
  140.         motor[LtBackWheel] = -speed;
  141.         motor[RtDrive] = -speed;
  142.         motor[RtBackWheel] = -speed;
  143.         motor[RtBackLift] = 127;
  144.         motor[RtFrontLift] = 127;
  145.         motor[LtBackLift] = 127;
  146.         motor[LtFrontLift] = 127;
  147.     }
  148.     motor[LtDrive] = 0;
  149.     motor[LtBackWheel] = 0;
  150.     motor[RtDrive] = 0;
  151.     motor[RtBackWheel] = 0;
  152.     motor[RtBackLift] = 0;
  153.     motor[RtFrontLift] = 0;
  154.     motor[LtBackLift] = 0;
  155.     motor[LtFrontLift] = 0;
  156. }
  157. void liftTime(int time)
  158. {
  159.     motor[RtFrontLift] = 127;
  160.     motor[LtFrontLift] = 127;
  161.     motor[RtBackLift] = 127;
  162.     motor[LtBackLift] = 127;
  163.     wait1Msec(time);
  164.     motor[RtFrontLift] = 0;
  165.     motor[LtFrontLift] = 0;
  166.     motor[RtBackLift] = 0;
  167.     motor[LtBackLift] = 0;
  168. }
  169. void liftHold()
  170. {
  171.     motor[RtFrontLift] = 10;
  172.     motor[LtFrontLift] = 10;
  173.     motor[RtBackLift] = 10;
  174.     motor[LtBackLift] = 10;
  175. }
  176.  
  177. void liftup(int distance, int speed)
  178. {
  179.     while(SensorValue[potentiometerLt] > distance/* && SensorValue[potentiometerLt] > distance*/)
  180.     {
  181.         motor[LtFrontLift] = speed;
  182.         motor[LtBackLift] = speed;
  183.         motor[RtFrontLift] = speed;
  184.         motor[RtBackLift] = speed;
  185.     }
  186.     motor[LtFrontLift] = 10;
  187.     motor[LtBackLift] = 10;
  188.     motor[RtFrontLift] = 10;
  189.     motor[RtBackLift] = 10;
  190. }
  191.  
  192. void liftdown(int distance, int speed)
  193. {
  194.     while(SensorValue[potentiometerRt] < distance)
  195.     {
  196.         motor[LtFrontLift] = -speed;
  197.         motor[LtBackLift] = -speed;
  198.         motor[RtFrontLift] = -speed;
  199.         motor[RtBackLift] = -speed;
  200.     }
  201.     motor[LtFrontLift] = 0;
  202.     motor[LtBackLift] = 0;
  203.     motor[RtFrontLift] = 0;
  204.     motor[RtFrontLift] = 0;
  205. }
  206.  
  207. void intake(int time, int speed)
  208. {
  209.     motor[Intake1] = -speed;
  210.     motor[Intake2] = -speed;
  211.  
  212.     wait1Msec(time);
  213.  
  214.     motor[Intake1] = 0;
  215.     motor[Intake2] = 0;
  216.  
  217. }
  218.  
  219. void outtake(int time, int speed)
  220. {
  221.     motor[Intake1] = speed;
  222.     motor[Intake2] = speed;
  223.  
  224.     wait1Msec(time);
  225.  
  226.     motor[Intake1] = 0;
  227.     motor[Intake2] = 0;
  228. }
  229.  
  230. void skyriseintake()
  231. {
  232.     SensorValue[claw] = 1;
  233. }
  234.  
  235. void skyriseouttake()
  236. {
  237.     SensorValue[claw] = 0;
  238. }
  239.  
  240. void liftTick (int distance, int speed, int maxTicks)
  241. {
  242.     int ticks = 0;
  243.     while(ticks <= maxTicks)
  244.     {
  245.         if(SensorValue[potentiometerRt] > distance)
  246.         {
  247.             motor[LtFrontLift] = speed;
  248.             motor[LtBackLift] = speed;
  249.             motor[RtFrontLift] = speed;
  250.             motor[RtBackLift] = speed;
  251.         }
  252.         else if(SensorValue[potentiometerRt] < (distance - 150))
  253.         {
  254.             motor[RtFrontLift] = -speed;
  255.             motor[LtFrontLift] = -speed;
  256.             motor[RtBackLift] = -speed;
  257.             motor[LtBackLift] = -speed;
  258.         }
  259.         else
  260.         {
  261.             motor[LtFrontLift] = 10;
  262.             motor[LtBackLift] = 10;
  263.             motor[RtFrontLift] = 10;
  264.             motor[RtBackLift] = 10;
  265.             ticks++;
  266.         }
  267.         wait1Msec(25);
  268.     }
  269.     motor[LtFrontLift] = 0;
  270.     motor[LtBackLift] = 0;
  271.     motor[RtFrontLift] = 0;
  272.     motor[RtBackLift] = 0;
  273. }
  274. void intakefwds(int distance, int speed)
  275. {
  276.     nMotorEncoder[RtBackWheel] = 0;
  277.     nMotorEncoder[LtBackWheel] = 0;
  278.     while(nMotorEncoder[RtBackWheel] < distance && nMotorEncoder[LtBackWheel] > (distance * -1))
  279.     {
  280.         motor[LtDrive] = speed;
  281.         motor[LtBackWheel] = speed;
  282.         motor[RtDrive] = speed;
  283.         motor[RtBackWheel] = speed;
  284.         motor[Intake1] = -127;
  285.         motor[Intake2] = -127;
  286.     }
  287.     motor[LtDrive] = 0;
  288.     motor[LtBackWheel] = 0;
  289.     motor[RtDrive] = 0;
  290.     motor[RtBackWheel] = 0;
  291.     motor[Intake1] = 0;
  292.     motor[Intake2] = 0;
  293. }
  294. void setup()
  295. {
  296.     SensorType[in1] = sensorNone;
  297.     SensorType[in1] = sensorGyro;
  298.     outtake(250,127);
  299.     intake(250,127);
  300.     outtake(250,127);
  301.     intake(250,127);
  302.     motor[RtFrontLift] = 127;
  303.     motor[LtFrontLift] = 127;
  304.     motor[RtBackLift] = 127;
  305.     motor[LtBackLift] = 127;
  306.     wait1Msec(300);
  307.     motor[RtFrontLift] = -10;
  308.     motor[LtFrontLift] = -10;
  309.     motor[RtBackLift] = -10;
  310.     motor[LtBackLift] = -10;
  311.     wait1Msec(200);
  312.     motor[RtFrontLift] = 127;
  313.     motor[LtFrontLift] = 127;
  314.     motor[RtBackLift] = 127;
  315.     motor[LtBackLift] = 127;
  316.     wait1Msec(400);
  317.     liftdown(2500,127);
  318. }
  319. void pre_auton()
  320. {
  321.  
  322.     // Set bStopTasksBetweenModes to false if you want to keep user created tasks running between
  323.     // Autonomous and Tele-Op modes. You will need to manage all user created tasks if set to false.
  324.     bStopTasksBetweenModes = true;
  325.  
  326.     // All activities that occur before the competition starts
  327.     // Example: clearing encoders, setting servo positions, ...
  328. }
  329.  
  330. /////////////////////////////////////////////////////////////////////////////////////////
  331. //
  332. //                                 Autonomous Task
  333. //
  334. // This task is used to control your robot during the autonomous phase of a VEX Competition.
  335. // You must modify the code to add your own robot specific commands here.
  336. //
  337. /////////////////////////////////////////////////////////////////////////////////////////
  338.  
  339. task autonomous()
  340. {
  341.     //function(distance/time, speed)
  342.     //not actual auton
  343.     setup();
  344.     intakefwds(500,100);
  345.     intake(500,127);
  346.     turn(3000,100,RIGHT);
  347. }
  348.  
  349.  
  350. // .....................................................................................
  351. // Insert user code here.
  352. // .....................................................................................
  353.  
  354.  
  355. //  AutonomousCodePlaceholderForTesting();  // Remove this function call once you have "real" code.
  356.  
  357.  
  358. /////////////////////////////////////////////////////////////////////////////////////////
  359. //
  360. //                                 User Control Task
  361. //
  362. // This task is used to control your robot during the user control phase of a VEX Competition.
  363. // You must modify the code to add your own robot specific commands here.
  364. //
  365. /////////////////////////////////////////////////////////////////////////////////////////
  366. int error;
  367. float kP = 0.6 ;
  368. int offSet;
  369. //bool threshold;
  370. //bool toTheRight;
  371. //bool toTheLeft;
  372. task usercontrol()
  373. {
  374.     // User control code here, inside the loop
  375.     int RT1;
  376.     int RT2;
  377.     while (true)
  378.     {
  379.  
  380.         if(vexRT[Btn8D] == 1)
  381.         {
  382.             //actual auton
  383.             setup();
  384.             intakefwds(500,40);
  385.             intake(1500,127);
  386.             fwds(800,100);
  387.             bwds(100,100);
  388.             swing(250,100,LEFT);
  389.             bwds(500,100);
  390.             turn(130,100,LEFT);
  391.             bwds(200,100);
  392.             liftup(1200,127);
  393.         }
  394.  
  395.         //Lift adjust
  396.         /*if(abs(SensorValue(potentiometerRt) - (SensorValue(potentiometerLt) + offSet)) > 200)
  397.         {
  398.         threshold = true;
  399.         }
  400.         else
  401.         {
  402.         threshold = false;
  403.         }*/
  404.         if(SensorValue(potentiometerLt) > 1860)
  405.         {
  406.             offSet = 40;
  407.         }
  408.         else if(SensorValue(potentiometerLt) > 1175)
  409.         {
  410.             offSet = 40;
  411.         }
  412.         else
  413.         {
  414.             offSet = 40;
  415.         }
  416.  
  417.         error = abs(SensorValue(potentiometerRt) - (SensorValue(potentiometerLt) + offSet)) * kP;
  418.  
  419.         //Automagic
  420.         if( vexRT[ Btn7U ] == 1 )
  421.         {
  422.             if( ! buttonPressed3)
  423.             {
  424.  
  425.                 if(SensorValue[potentiometerLt] > SensorValue[potentiometerRt])
  426.                 {
  427.                     leftHigher = false;
  428.                 }
  429.                 else
  430.                 {
  431.                     leftHigher = true;
  432.                 }
  433.  
  434.  
  435.                 buttonPressed3 = 1;
  436.             }
  437.         }
  438.         else
  439.         {
  440.  
  441.             buttonPressed3 = 0;
  442.         }
  443.         if( vexRT[ Btn7D ] == 1 )
  444.         {
  445.             if( ! buttonPressed4)
  446.             {
  447.  
  448.                 if((SensorValue[potentiometerLt] + 100) > SensorValue[potentiometerRt])
  449.                 {
  450.                     RightLower = true;
  451.                 }
  452.                 else
  453.                 {
  454.                     RightLower = false;
  455.                 }
  456.  
  457.  
  458.                 buttonPressed4 = 1;
  459.             }
  460.         }
  461.         else
  462.         {
  463.  
  464.             buttonPressed4 = 0;
  465.         }
  466.         //Base
  467.         RT1 = vexRT[Ch2];
  468.         RT2 = vexRT[Ch3];
  469.  
  470.  
  471.         if(RT2 > 0)
  472.         {
  473.             motor[LtDrive] = TrueSpeed[RT2];
  474.             motor[LtBackWheel] = TrueSpeed[RT2];
  475.         }
  476.         else if(RT2 < 0)
  477.         {
  478.             RT2 = RT2 * -1;
  479.             motor[LtDrive] = -TrueSpeed[RT2];
  480.             motor[LtBackWheel] = -TrueSpeed[RT2];
  481.         }
  482.  
  483.         if(RT1 > 0)
  484.         {
  485.             motor[RtDrive] = TrueSpeed[RT1];
  486.             motor[RtBackWheel] = TrueSpeed[RT1];
  487.         }
  488.         else if(RT1 < 0)
  489.         {
  490.             RT1 = RT1 * -1;
  491.             motor[RtDrive] = -TrueSpeed[RT1];
  492.             motor[RtBackWheel] = -TrueSpeed[RT1];
  493.         }
  494.  
  495.         //Lift
  496.  
  497.  
  498.         if(vexRT[Btn7D] == 1 && RightLower)//Automagic down
  499.         {
  500.             motor[RtFrontLift] = -50;
  501.             motor[LtFrontLift] = 17;
  502.             motor[RtBackLift] = -50;
  503.             motor[LtBackLift] = 17;
  504.         }
  505.         else if(vexRT[Btn7D] == 1 && !RightLower)
  506.         {
  507.             motor[RtFrontLift] = 17;
  508.             motor[LtFrontLift] = -50;
  509.             motor[RtBackLift] = 17;
  510.             motor[LtBackLift] = -50;
  511.         }
  512.         else if(vexRT[Btn7U] == 1 && !leftHigher)//Automagic up
  513.         {
  514.             motor[RtFrontLift] = 40;
  515.             motor[LtFrontLift] = 80;
  516.             motor[RtBackLift] = 40;
  517.             motor[LtBackLift] = 80;
  518.         }
  519.         else if(vexRT[Btn7U] == 1 && leftHigher)
  520.         {
  521.             motor[RtFrontLift] = 80;
  522.             motor[LtFrontLift] = 40;
  523.             motor[RtBackLift] = 80;
  524.             motor[LtBackLift] = 40;
  525.         }
  526.         else if(vexRT[Btn5D] == 1 && vexRT[Btn5U] == 1)//lifthold
  527.         {
  528.             motor[RtFrontLift] = 10;
  529.             motor[LtFrontLift] = 10;
  530.             motor[RtBackLift] = 10;
  531.             motor[LtBackLift] = 10;
  532.         }
  533.         else if(vexRT[Btn8L] == 1)//lift adjust
  534.         {
  535.             if((SensorValue(potentiometerLt) + offSet) > SensorValue(potentiometerRt)/* && threshold*/)
  536.             {
  537.                 motor[RtFrontLift] = 127 - error;
  538.                 motor[LtFrontLift] = 127;
  539.                 motor[RtBackLift] = 127 - error;
  540.                 motor[LtBackLift] = 127;
  541.             }
  542.             else if(SensorValue(potentiometerRt) > (SensorValue(potentiometerLt) + offSet)/* && threshold*/)
  543.             {
  544.                 motor[RtFrontLift] = 127;
  545.                 motor[LtFrontLift] = 127 - error;
  546.                 motor[RtBackLift] = 127;
  547.                 motor[LtBackLift] = 127 - error;
  548.             }
  549.             else
  550.             {
  551.                 motor[RtFrontLift] = 127;
  552.                 motor[LtFrontLift] = 127;
  553.                 motor[RtBackLift] = 127;
  554.                 motor[LtBackLift] = 127;
  555.             }
  556.         }
  557.         else if(vexRT[Btn5D] == 1)//lift down
  558.         {
  559.             motor[RtFrontLift] = -127;
  560.             motor[LtFrontLift] = -127;
  561.             motor[RtBackLift] = -127;
  562.             motor[LtBackLift] = -127;
  563.         }
  564.         else if(vexRT[Btn5U] == 1)//lift up
  565.         {
  566.             motor[RtFrontLift] = 127;
  567.             motor[LtFrontLift] = 127;
  568.             motor[RtBackLift] = 127;
  569.             motor[LtBackLift] = 127;
  570.         }
  571.         else if(vexRT[Btn7L] == 1)//autotap
  572.         {
  573.             if(SensorValue(potentiometerRt) > 2300)
  574.             {
  575.                 if(SensorValue(potentiometerRt) > 2450)
  576.                 {
  577.                     motor[RtFrontLift] = 30;
  578.                     motor[LtFrontLift] = 30;
  579.                     motor[RtBackLift] = 30;
  580.                     motor[LtBackLift] = 30;
  581.                 }
  582.                 else
  583.                 {
  584.                     motor[RtFrontLift] = 10;
  585.                     motor[LtFrontLift] = 10;
  586.                     motor[RtBackLift] = 10;
  587.                     motor[LtBackLift] = 10;
  588.                 }
  589.             }
  590.             else
  591.             {
  592.                 if(SensorValue(potentiometerRt) < 2300)
  593.                 {
  594.                     motor[RtFrontLift] = -127;
  595.                     motor[LtFrontLift] = -127;
  596.                     motor[RtBackLift] = -127;
  597.                     motor[LtBackLift] = -127;
  598.                 }
  599.                 else
  600.                 {
  601.                     motor[RtFrontLift] = 10;
  602.                     motor[LtFrontLift] = 10;
  603.                     motor[RtBackLift] = 10;
  604.                     motor[LtBackLift] = 10;
  605.                 }
  606.             }
  607.         }
  608.         else
  609.         {
  610.             motor[RtFrontLift] = 0;
  611.             motor[LtFrontLift] = 0;
  612.             motor[RtBackLift] = 0;
  613.             motor[LtBackLift] = 0;
  614.         }
  615.  
  616.         //Intake
  617.         if(vexRT[Btn6D] == 1)
  618.         {
  619.             motor[Intake1] = 127;
  620.             motor[Intake2] = 127;
  621.         }
  622.         else if (vexRT[Btn6U] == 1)
  623.         {
  624.             motor[Intake1] = -110;
  625.             motor[Intake2] = -110;
  626.         }
  627.         else
  628.         {
  629.             motor[Intake1] = 0;
  630.             motor[Intake2] = 0;
  631.         }
  632.  
  633.  
  634.         //Pneumatics
  635.         if( vexRT[ Btn8R ] == 1 )
  636.         {
  637.             if( ! buttonPressed1 )
  638.             {
  639.  
  640.                 buttonToggleState1 = 1 - buttonToggleState1;
  641.  
  642.  
  643.                 buttonPressed1 = 1;
  644.             }
  645.         }
  646.         else
  647.         {
  648.  
  649.             buttonPressed1 = 0;
  650.         }
  651.  
  652.         if(buttonToggleState1)SensorValue[claw] = 1;
  653.         else SensorValue[claw] = 0;
  654.  
  655.  
  656.         if( vexRT[ Btn8U ] == 1 )
  657.         {
  658.             if( ! buttonPressed2 )
  659.             {
  660.  
  661.                 buttonToggleState2 = 1 - buttonToggleState2;
  662.  
  663.  
  664.                 buttonPressed2 = 1;
  665.             }
  666.         }
  667.         else
  668.         {
  669.  
  670.             buttonPressed2 = 0;
  671.         }
  672.  
  673.         if(buttonToggleState2)SensorValue[platform] = 1;
  674.         else SensorValue[platform] = 0;
  675.  
  676.         //Skyrise
  677.         //      UserControlCodePlaceholderForTesting();
  678.     }
  679. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement