summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-12-12 21:00:27 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-12-12 21:00:27 -0500
commitb8afaf4aaf1c6e71e6a1610df003f2df0806474f (patch)
treed8b32249ff91579f996e20f346bb1f1d2f594b42
parent29fb8dd18f29e297a61b1ea7453f4cc857d14af0 (diff)
timeout removal
-rw-r--r--vexuser.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/vexuser.cpp b/vexuser.cpp
index 880554e..7b4ca69 100644
--- a/vexuser.cpp
+++ b/vexuser.cpp
@@ -205,25 +205,25 @@ msg_t vexLiftTask(void *arg)
vexTaskRegister("lcdtask");
- static int timeout = -1;
+ //static int timeout = -1;
while (!chThdShouldTerminate()) {
int actual = vexEncoderGet(kVexQuadEncoder_1);
int diff = liftTargetLoc - actual;
- int speed;
+ int speed = 0;
if (diff != 0) {
- speed = 2 * diff;
-
- if (timeout == -1)
+ /*if (timeout == -1)
timeout = 10;
else if (timeout > 0)
timeout--;
else
- diff++;
+ diff *= 2;*/
+
+ speed = 2 * diff;
} else {
- timeout = -1, speed = 0;
+ /*timeout = -1,*/ speed = 0;
}
- vexLcdPrintf(0, 1, "%4d | %4d", actual, speed);
+ //vexLcdPrintf(0, 1, "A%02d T%02d S%d", actual, timeout, speed);
vexMotorSet(mLiftLowLeft, speed);
vexMotorSet(mLiftHighLeft, speed);
vexMotorSet(mLiftLowRight, speed);
@@ -261,6 +261,15 @@ msg_t vexOperator(void *arg)
else if (vexControllerGet(Btn5D))
liftTargetLoc -= 5;
+ if (vexControllerGet(Btn8D))
+ liftTargetLoc = 0;
+ else if (vexControllerGet(Btn8L))
+ liftTargetLoc = 30;
+ else if (vexControllerGet(Btn8R))
+ liftTargetLoc = 60;
+ else if (vexControllerGet(Btn8U))
+ liftTargetLoc = 90;
+
int claw = (vexControllerGet(Btn6U) ? 127 : (vexControllerGet(Btn6D) ? -127 : 0));
vexMotorSet(mClaw, claw);