]> code.bitgloo.com Git - abelleisle/vex5106z.git/commitdiff
it works? master
authorClyne Sullivan <tullivan99@gmail.com>
Sat, 20 Feb 2016 16:19:47 +0000 (11:19 -0500)
committerClyne Sullivan <tullivan99@gmail.com>
Sat, 20 Feb 2016 16:19:47 +0000 (11:19 -0500)
firmware/libccos.a
include/arm.h [new file with mode: 0644]
include/main.h
src/init.c
src/opcontrol.c

index 469b3305c2637989819bc42659329dc505016501..d79a629db75b9113a54c6de797e1e701043f9390 100644 (file)
Binary files a/firmware/libccos.a and b/firmware/libccos.a differ
diff --git a/include/arm.h b/include/arm.h
new file mode 100644 (file)
index 0000000..51a485b
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef INCLUDE_ARM_H_
+#define INCLUDE_ARM_H_
+
+#include <stdint.h>
+
+typedef void (*funcptr_t)(void);
+
+volatile struct _ExceptionTable {
+       funcptr_t unknown1;
+       funcptr_t entry;
+       funcptr_t NMIException;
+       funcptr_t HardFaultException;
+       funcptr_t MemManageException;
+       funcptr_t BusFaultException;
+       funcptr_t UsageFaultException;
+       funcptr_t unknown2[4];
+       funcptr_t SVCHandler;
+       funcptr_t DebugMonitor;
+       funcptr_t unknown3;
+       funcptr_t PendSVC;
+       funcptr_t SysTickHandler;
+       funcptr_t InterruptHandler[];
+} __attribute__ ((packed)) *ExceptionTable;
+
+volatile struct _SystemControlBlock {
+       uint32_t CPUID;
+       uint32_t ICSR;
+       uint32_t VTOR;
+       uint32_t AIRCR;
+       uint32_t SCR;
+       uint32_t CCR;
+       uint32_t SHPR[3];
+       uint32_t SHCRS;
+       uint8_t  MMSR;
+       uint8_t  BFSR;
+       uint16_t UFSR;
+       uint32_t HFSR;
+       uint32_t unused1;
+       uint32_t MMAR;
+       uint32_t BFAR;
+       uint32_t AFSR;
+} __attribute__ ((packed)) *SystemControlBlock = (struct _SystemControlBlock *)0xE000ED00;
+
+/**
+ * "Allow" divide by zero instructions to be run.
+ *
+ * By setting this bit in the CCR the Cortex will handle divide by zero
+ * instructions by returning a quotient of 0.
+ */
+
+void handleDiv0(void){
+       SystemControlBlock->CCR |= (1<<4);
+}
+
+#endif // INCLUDE_ARM_H_
index d0ee41b691bfb33068e6b7e694b5276e508a5702..d680b2bda21389399d55c3181889f380543b4c15 100644 (file)
 #include <API.h>\r
 #include <stdint.h>\r
 \r
 #include <API.h>\r
 #include <stdint.h>\r
 \r
+/**\r
+ * A two-dimensional vector structure.\r
+ *\r
+ * This structure contains a 2D coordinate for organized storage.\r
+ */\r
+\r
 typedef struct{\r
 typedef struct{\r
-       int x;\r
-       int y;\r
-}vec2;\r
+       int x; /**< The 'x' coordinate */\r
+       int y; /**< The 'y' coordinate */\r
+} vec2;\r
+\r
+/**\r
+ * An enum for storing a button's position.\r
+ *\r
+ * The controller subsystem allows buttons to generate three signals. These are\r
+ * the expected pressed and unpressed states, named DOWN and UP respectively,\r
+ * along with a third signal called KEY_UP that is sent out upon the immediate\r
+ * release of a button. This allows for one-time events to be called on button\r
+ * releases.\r
+ */\r
 \r
 typedef enum {\r
 \r
 typedef enum {\r
-       UP,\r
-       DOWN,\r
-       KEY_UP\r
+       UP,             /**< The unpressed state                */\r
+       DOWN,   /**< The pressed state                  */\r
+       KEY_UP  /**< The 'just-released' state  */\r
 } Button;\r
 \r
 } Button;\r
 \r
+/**\r
+ * A structure for storing all input states of a single controller.\r
+ *\r
+ * This object groups a joystick's axes and buttons in a convenient manner,\r
+ * with simple function calls to poll inputs and update them.\r
+ */\r
+\r
 typedef struct {\r
 typedef struct {\r
-       unsigned int num;\r
+       unsigned int num;       /**< The joystick's number as seen by PROS */\r
+\r
+       /**\r
+        * The 'Side' structures separate the left and right halves of the\r
+        * controller.\r
+        */\r
+\r
        struct Side {\r
        struct Side {\r
+\r
+               /**\r
+                * The 'Group' structure groups the buttons as written on the\r
+                * controller.\r
+                */\r
+\r
                struct Group {\r
                struct Group {\r
-                       Button l;\r
-                       Button r;\r
-                       Button u;\r
-                       Button d;\r
+                       Button l;       /**< The left button, if it exists      */\r
+                       Button r;       /**< The right button, if it exists     */\r
+                       Button u;       /**< The up button                                      */\r
+                       Button d;       /**< The down button                            */\r
                } front, back;\r
                } front, back;\r
-               vec2 stick;\r
+\r
+               vec2 stick;     /**< The joystick's position, stored as a 2D coordinate. */\r
+\r
        } left, right;\r
        } left, right;\r
+\r
 } Controller;\r
 \r
 } Controller;\r
 \r
+/**\r
+ * A structure for handling most robot sensors.\r
+ *\r
+ * This structure contains the information necessary to handle most of the\r
+ * sensors provided by VEX, and allows for easier sensor reading and handling.\r
+ */\r
+\r
 typedef struct {\r
 typedef struct {\r
+\r
+       /**\r
+        * A 'type' enum for recognizing the sensor's type.\r
+        */\r
+\r
        enum type {\r
        enum type {\r
-               DIGITAL,\r
-               ANALOG,\r
-               GYRO,\r
-               ULTRASONIC\r
+               DIGITAL,        /**< A generic digital sensor   */\r
+               ANALOG,         /**< A generic analog sensor    */\r
+               GYRO,           /**< A gyroscore (BROKEN)               */\r
+               ULTRASONIC      /**< An ultrasonic sensor               */\r
        } type;\r
        } type;\r
+\r
+       /**\r
+        * A special 'data' item for sensors that need extra variables.\r
+        */\r
+\r
        union data {\r
        union data {\r
-               Gyro gyro;\r
-               Ultrasonic sonic;\r
+               Gyro gyro;                      /**< The gyroscope object provided by PROS      */\r
+               Ultrasonic sonic;       /**< The ultrasonic object provided by PROS     */\r
        } data;\r
        } data;\r
-       unsigned int port;\r
-       int value;\r
-       int initial;\r
+\r
+       unsigned int port;      /**< The port that the sensor is connected to   */\r
+       int value;                      /**< The most recent value of the sensor                */\r
+       int initial;            /**< The initial reading from the sensor                */\r
 } Sensor;\r
 \r
 } Sensor;\r
 \r
+/**\r
+ * A structure for tracking processes.\r
+ *\r
+ * This object contains most information about a task, as well as flags for\r
+ * controlling the task's state.\r
+ */\r
+\r
 typedef struct {\r
 typedef struct {\r
-       bool        kill_req;\r
-       bool            exiting;\r
-       TaskCode    code;\r
-       TaskHandle  handle;\r
-       void       *param;\r
+       bool kill_req;          /**< A kill request signal for ending the process       */\r
+       TaskCode code;          /**< The function that is the task                                      */\r
+       TaskHandle handle;      /**< The task handle provided by PROS                           */\r
+       void *param;            /**< The argument provided for the task                         */\r
 } Process;\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
 } Process;\r
 \r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
 \r
-#define DEFAULT_TRPM trpm = 1850;\r
-#define EXTRA_TRPM      trpm = 1900;\r
+/**\r
+ * A macro for setting the target RPM to it's default value.\r
+ */\r
+\r
+#define DEFAULT_TRPM trpm = 1650;\r
+\r
+/**\r
+ * A macro for setting the target RPM to a little higher than usually\r
+ * necessary.\r
+ */\r
+\r
+#define EXTRA_TRPM      trpm = 1650;\r
+\r
+/**\r
+ * The mathematical constant 'pi', for trig/angular calculations.\r
+ */\r
 \r
 #define PI 3.14159265L\r
 \r
 \r
 #define PI 3.14159265L\r
 \r
+/**\r
+ * The port that an LCD is expected to be plugged into.\r
+ */\r
+\r
 #define LCD_PORT uart2\r
 \r
 /**\r
 #define LCD_PORT uart2\r
 \r
 /**\r
- * Be sure that getIMEPort() matches these values (see sensor.c).\r
+ * An enum for the set of motor ports on the Cortex, for tagging what motors\r
+ * are.\r
+ *\r
+ * The getIMEPort() function defined in sensor.c takes these values for\r
+ * accessing their IME counterparts, so insure that this definition matches\r
+ * what getIMEPort() expects.\r
  */\r
 \r
 enum MOTOR_MAP {\r
  */\r
 \r
 enum MOTOR_MAP {\r
@@ -80,6 +165,13 @@ enum MOTOR_MAP {
        LIFT_ROTATER\r
 };\r
 \r
        LIFT_ROTATER\r
 };\r
 \r
+/**\r
+ * An enum for tagging IMEs.\r
+ *\r
+ * getIMEPort() will allow access to these values by referencing their\r
+ * MOTOR_MAP counterparts, so hard-coding these shouldn't be necessary.\r
+ */\r
+\r
 enum MOTOR_IME_MAP {\r
        DRIVE_RIGHT_IME = 0,\r
        DRIVE_LEFT_IME,\r
 enum MOTOR_IME_MAP {\r
        DRIVE_RIGHT_IME = 0,\r
        DRIVE_LEFT_IME,\r
index f8154d7808756e8475747cf07c1d196ea920cd91..704b1993cd2e2d535b81ae4128d1c3dc68cda2d7 100644 (file)
@@ -16,6 +16,9 @@ void initializeIO(void){
        intakeLiftBase   = initUltrasonic(1,2);\r
        intakeLiftTop    = initSensor(8,ANALOG);\r
        //robotGyro        = initSensor(2,GYRO);\r
        intakeLiftBase   = initUltrasonic(1,2);\r
        intakeLiftTop    = initSensor(8,ANALOG);\r
        //robotGyro        = initSensor(2,GYRO);\r
+\r
+       pinMode(12,OUTPUT);\r
+       digitalWrite(12,1);\r
 }\r
 \r
 void initialize(void){\r
 }\r
 \r
 void initialize(void){\r
index 1efcb101e4893babf6e695582effc83f48ee7d45..a549e5746f9a89eb8e62d507ccd1dac8922eab2c 100644 (file)
@@ -1,7 +1,12 @@
 #include <main.h>\r
 #include <math.h>\r
 \r
 #include <main.h>\r
 #include <math.h>\r
 \r
-#define AUTO_SKILLS\r
+#include <arm.h>\r
+\r
+#define PUSH_UP                500\r
+#define PUSH_BACK      500\r
+\r
+//#define AUTO_SKILLS\r
 \r
 extern Sensor intakeFrontLeft,\r
                          intakeFrontRight,\r
 \r
 extern Sensor intakeFrontLeft,\r
                          intakeFrontRight,\r
@@ -25,7 +30,7 @@ static float xpos = 0,
 \r
 static double cangle = 0;\r
 \r
 \r
 static double cangle = 0;\r
 \r
-static double rpm = 0, trpm = 1850, arpm = 0;\r
+static double rpm = 0, trpm = 1650, arpm = 0;\r
 static bool cannReady = false;\r
 \r
 static Controller c[2];\r
 static bool cannReady = false;\r
 \r
 static Controller c[2];\r
@@ -40,9 +45,23 @@ void taskArmCode(void *);    //      100ms
 void taskAimCode(void *);      //      100ms\r
 void taskLCDCode(void *);      //      500ms\r
 \r
 void taskAimCode(void *);      //      100ms\r
 void taskLCDCode(void *);      //      500ms\r
 \r
+static unsigned int cid = 0;\r
+\r
+\r
+const char *dream = "CarryOnM:d=8,o=6,b=125:a5,c,d,c,b5,a5,4a5,a5,g5,4a5,4b5,4p,a5,c,d,c,b5,a5,4e,d,c,4c,4d,4p,f,f,e,d,d,c,4e,2d,4p,f,f,4e,d,c,2g5,4p,a5,c,d,c,b5,a5,4a5,a5,g5,4a5,4b5,4p,a5,c,d,c,b5,a5,4e,d,c,4c,4d,4p,f,f,e,d,d,c,4e,2d,4p,f,f,4e,4g,2g";\r
+const char *final = "FinalCou:d=4,o=5,b=140:16c#6,32b,32p,8c#.6,16p,f#,p.,32d6,32p,32c#6,32p,32d6,16p.,32c#6,16p.,b.,p,32d6,32p,32c#6,32p,d6,f#,p.,32b,32p,32a,32p,32b,16p.,32a,16p.,32g#,16p.,32b,16p.,a.,32c#6,32p,32b,32p,c#6,2f#,p,16p,32d6,32p,32c#6,32p,32d6,16p.,32c#6,16p.,b.,p,32d6,32p,32c#6,32p,d6,f#,p.,32b,32p,32a,32p,32b,16p.,32a,16p.,32g#,16p.,32b,16p.,2a,16p,32g#,32p,32a,32p,b.,16a,16b,8c#6,8b,8a,8g#,f#,d6,1c#6,8p,16c#6,16d6,16c#6,16b,2c#.6,16p";\r
+\r
+\r
+void cdelay(unsigned int id,unsigned int ms){\r
+       cid = id;\r
+       delay(ms);\r
+}\r
+\r
 void operatorControl(void){\r
        static bool invert;\r
 \r
 void operatorControl(void){\r
        static bool invert;\r
 \r
+       handleDiv0();\r
+\r
        DEFAULT_TRPM;\r
        c[0].num = 1;\r
        c[1].num = 2;\r
        DEFAULT_TRPM;\r
        c[0].num = 1;\r
        c[1].num = 2;\r
@@ -70,9 +89,6 @@ void operatorControl(void){
        taskInit(taskLCD,NULL);\r
        taskInit(taskPos,NULL);\r
 \r
        taskInit(taskLCD,NULL);\r
        taskInit(taskPos,NULL);\r
 \r
-       if(taskCan)\r
-               taskDelete(taskCan);\r
-\r
        while(1){\r
 \r
                /**\r
        while(1){\r
 \r
                /**\r
@@ -104,6 +120,17 @@ void operatorControl(void){
                onKeyUp(c[0].right.front.r) invert ^= true;\r
                onKeyUp(c[1].right.front.r) invert ^= true;\r
 \r
                onKeyUp(c[0].right.front.r) invert ^= true;\r
                onKeyUp(c[1].right.front.r) invert ^= true;\r
 \r
+               if(keyUp(c[0].left.front.r)){\r
+                       speakerInit();\r
+                       speakerPlayRtttl(final);\r
+                       speakerShutdown();\r
+               }\r
+               if(keyUp(c[0].left.front.l)){\r
+                       speakerInit();\r
+                       speakerPlayRtttl(dream);\r
+                       speakerShutdown();\r
+               }\r
+\r
                motorSetN(DRIVE_LEFT ,c[0].left.stick.y);\r
                motorSetN(DRIVE_RIGHT,c[0].right.stick.y);\r
 \r
                motorSetN(DRIVE_LEFT ,c[0].left.stick.y);\r
                motorSetN(DRIVE_RIGHT,c[0].right.stick.y);\r
 \r
@@ -118,6 +145,8 @@ void operatorControl(void){
 \r
                motorSetN(LIFT_ROTATER,-c[1].right.stick.x / 4);\r
 \r
 \r
                motorSetN(LIFT_ROTATER,-c[1].right.stick.x / 4);\r
 \r
+               //motorSetBN(LIFT_PUSHER,127,c[1].left.front);\r
+\r
                delay(50);\r
        }\r
 }\r
                delay(50);\r
        }\r
 }\r
@@ -140,7 +169,8 @@ void taskLiftCode(void *unused){
        motorSetK(INTAKE_2,127,1);\r
 \r
        do{\r
        motorSetK(INTAKE_2,127,1);\r
 \r
        do{\r
-               turned = (cangle > 30) | (cangle < -30);\r
+\r
+               turned = (cangle > 40) | (cangle < -40);\r
                loaded = underSensor(intakeLiftTop,LIGHT_THRESH_DEFAULT);\r
 \r
                /*\r
                loaded = underSensor(intakeLiftTop,LIGHT_THRESH_DEFAULT);\r
 \r
                /*\r
@@ -205,6 +235,7 @@ void taskAimCode(void *unused){
        target = cangle;\r
 \r
        do{\r
        target = cangle;\r
 \r
        do{\r
+\r
                if(cangle > target){\r
                        motorSetK(LIFT_ROTATER,30,4);\r
                }else if(cangle < target){\r
                if(cangle > target){\r
                        motorSetK(LIFT_ROTATER,30,4);\r
                }else if(cangle < target){\r
@@ -336,13 +367,13 @@ void taskCanCode(void *unused){
                 */\r
 \r
                if(xpos < 20)\r
                 */\r
 \r
                if(xpos < 20)\r
-                       trpm = 1850;\r
+                       trpm = 1650;\r
                else if(xpos < 40)\r
                else if(xpos < 40)\r
-                       trpm = 1750;\r
+                       trpm = 1550;\r
                else if(xpos < 60)\r
                else if(xpos < 60)\r
-                       trpm = 1650;\r
+                       trpm = 1450;\r
                else\r
                else\r
-                       trpm = 1550;\r
+                       trpm = 1350;\r
 \r
                trpm += arpm;\r
 \r
 \r
                trpm += arpm;\r
 \r
@@ -353,7 +384,7 @@ void taskCanCode(void *unused){
                 */\r
 \r
                if(ca < trpm - 40){\r
                 */\r
 \r
                if(ca < trpm - 40){\r
-                       speed += 2 * ((trpm - rpm) / 60);\r
+                       speed += 2;\r
                        motorSetK(CANNON_LEFT,-speed,2);\r
                        motorSetK(CANNON_RIGHT,speed,2);\r
                        cannReady = false;\r
                        motorSetK(CANNON_LEFT,-speed,2);\r
                        motorSetK(CANNON_RIGHT,speed,2);\r
                        cannReady = false;\r
@@ -368,6 +399,7 @@ void taskCanCode(void *unused){
                delay(100);\r
        }\r
 \r
                delay(100);\r
        }\r
 \r
+\r
        motorSetK(CANNON_LEFT,0,2);\r
        motorSetK(CANNON_RIGHT,0,2);\r
 \r
        motorSetK(CANNON_LEFT,0,2);\r
        motorSetK(CANNON_RIGHT,0,2);\r
 \r
@@ -381,8 +413,8 @@ void taskCanCode(void *unused){
 }\r
 \r
 void taskArmCode(void *unused){\r
 }\r
 \r
 void taskArmCode(void *unused){\r
-       if(keyDown(c[1].left.front.r))\r
-               goto PUSH;\r
+       /*if(keyDown(c[1].left.front.r))\r
+               goto PUSH;*/\r
 \r
        while(!underSensor(intakeLiftTop,LIGHT_THRESH_DEFAULT) && ((rpm < trpm - 30) | (rpm > trpm + 50)))\r
                delay(100);\r
 \r
        while(!underSensor(intakeLiftTop,LIGHT_THRESH_DEFAULT) && ((rpm < trpm - 30) | (rpm > trpm + 50)))\r
                delay(100);\r
@@ -390,14 +422,14 @@ void taskArmCode(void *unused){
        /*while(ballPos != 5)\r
                delay(100);*/\r
 \r
        /*while(ballPos != 5)\r
                delay(100);*/\r
 \r
-PUSH:\r
+//PUSH:\r
 \r
        motorTake(LIFT_PUSHER,3);\r
 \r
        motorSetK(LIFT_PUSHER,127,3);\r
 \r
        motorTake(LIFT_PUSHER,3);\r
 \r
        motorSetK(LIFT_PUSHER,127,3);\r
-       delay(500);\r
+       delay(PUSH_UP);\r
        motorSetK(LIFT_PUSHER,-127,3);\r
        motorSetK(LIFT_PUSHER,-127,3);\r
-       delay(800);\r
+       delay(PUSH_BACK);\r
        motorSetK(LIFT_PUSHER,0,3);\r
 \r
        motorFree(LIFT_PUSHER);\r
        motorSetK(LIFT_PUSHER,0,3);\r
 \r
        motorFree(LIFT_PUSHER);\r
@@ -476,9 +508,9 @@ void autonomous(){
                        delay(500);\r
 \r
                        motorSet(LIFT_PUSHER,127);\r
                        delay(500);\r
 \r
                        motorSet(LIFT_PUSHER,127);\r
-                       delay(500);\r
+                       delay(PUSH_UP);\r
                        motorSet(LIFT_PUSHER,-127);\r
                        motorSet(LIFT_PUSHER,-127);\r
-                       delay(800);\r
+                       delay(PUSH_BACK);\r
                        motorSet(LIFT_PUSHER,0);\r
 \r
                        lcdPrint(LCD_PORT,2,"       ");\r
                        motorSet(LIFT_PUSHER,0);\r
 \r
                        lcdPrint(LCD_PORT,2,"       ");\r
@@ -495,11 +527,12 @@ void autonomous(){
  *****************************************************************************/\r
 \r
 void autonomous(){\r
  *****************************************************************************/\r
 \r
 void autonomous(){\r
-       static unsigned long start,elapsed = 0;\r
-       static unsigned long inc = 0;\r
+       //static unsigned long start,elapsed = 0;\r
+       static unsigned int inc = 0;\r
+       static bool onetime = false;\r
 \r
        EXTRA_TRPM;\r
 \r
        EXTRA_TRPM;\r
-       start = millis();\r
+       //start = millis();\r
        intakeLiftTop.initial = readSensor(&intakeLiftTop);\r
 \r
        taskInit(taskCan,&No);\r
        intakeLiftTop.initial = readSensor(&intakeLiftTop);\r
 \r
        taskInit(taskCan,&No);\r
@@ -510,39 +543,41 @@ void autonomous(){
        //motorSet(INTAKE_2,127);\r
 \r
        while(1){\r
        //motorSet(INTAKE_2,127);\r
 \r
        while(1){\r
-               elapsed = millis() - start;\r
+               //elapsed = millis() - start;\r
 \r
                if(++inc == 50){\r
                        inc = 0;\r
 \r
                if(++inc == 50){\r
                        inc = 0;\r
-                       lcdPrint(LCD_PORT,1,"%02d:%02d",(int)(elapsed / 60000),(int)((elapsed / 1000) % 60));\r
-                       lcdPrint(LCD_PORT,2,"%.0lf RPM",rpm);\r
+                       lcdPrint(LCD_PORT,1,"%.0lf/%.0lf",rpm,trpm);\r
                }\r
 \r
                readSensor(&intakeLiftTop);\r
                if(underSensor(intakeLiftTop,LIGHT_THRESH_DEFAULT)){\r
 \r
                }\r
 \r
                readSensor(&intakeLiftTop);\r
                if(underSensor(intakeLiftTop,LIGHT_THRESH_DEFAULT)){\r
 \r
-\r
-                       delay(200);\r
-                       motorSet(LIFT_1,0);\r
-                       motorSet(LIFT_2,0);\r
+                       if(!onetime){\r
+                               delay(400);\r
+                               motorSet(LIFT_1,0);\r
+                               motorSet(LIFT_2,0);\r
+                               onetime = true;\r
+                       }\r
                        //motorSet(INTAKE_1,0);\r
                        //motorSet(INTAKE_2,0);\r
 \r
                        //motorSet(INTAKE_1,0);\r
                        //motorSet(INTAKE_2,0);\r
 \r
-                       if(rpm >= trpm){\r
+                       if(rpm >= trpm - 50){\r
                                motorSet(LIFT_PUSHER,127);\r
                                motorSet(LIFT_PUSHER,127);\r
-                               delay(500);\r
+                               delay(PUSH_UP);\r
                                motorSet(LIFT_PUSHER,-127);\r
                                motorSet(LIFT_PUSHER,-127);\r
-                               delay(500);\r
+                               delay(PUSH_BACK);\r
                                motorSet(LIFT_PUSHER,0);\r
 \r
                                motorSet(LIFT_1,127);\r
                                motorSet(LIFT_2,127);\r
                                //motorSet(INTAKE_1,127);\r
                                //motorSet(INTAKE_2,127);\r
                                motorSet(LIFT_PUSHER,0);\r
 \r
                                motorSet(LIFT_1,127);\r
                                motorSet(LIFT_2,127);\r
                                //motorSet(INTAKE_1,127);\r
                                //motorSet(INTAKE_2,127);\r
+                               onetime = false;\r
                        }\r
                }\r
 \r
                        }\r
                }\r
 \r
-               delay(10);\r
+               delay(100);\r
        }\r
 }\r
 \r
        }\r
 }\r
 \r