From 42075fee578ca2155762471a8d905569b3229da1 Mon Sep 17 00:00:00 2001 From: Jonathan Damico Date: Mon, 12 Oct 2015 21:19:00 -0700 Subject: [PATCH 1/3] add my changes --- 2016CWS8.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/2016CWS8.c b/2016CWS8.c index 31d5353..97061de 100644 --- a/2016CWS8.c +++ b/2016CWS8.c @@ -24,6 +24,7 @@ int motorSpeed = 0; //float velocity; int waitTime = 270; +bool isOkayToShoot; void speedUpFlywheel(){ while(motorSpeed < 90){ @@ -82,24 +83,30 @@ task shooter(){ task drive(){ while(true){ - motor[LFdrive] = vexRT(Ch3); - motor[LBMdrive] = vexRT(Ch3); - motor[RFdrive] = vexRT(Ch2); - motor[RBMdrive] = vexRT(Ch2); + motor[LFdrive] = vexRT(Ch3); + motor[LBMdrive] = vexRT(Ch3); + motor[RFdrive] = vexRT(Ch2); + motor[RBMdrive] = vexRT(Ch2); wait1Msec(25); } } +task loadFireTimer () { + isOkayToShoot = false; + wait1Msec(waitTime); + isOkayToShoot = true; +} + task loadFire(){ // make this shit simpler while(true){ - while(!SensorValue(ballHigh)){ + while(!SensorValue(ballHigh)) motor[feeder] = 127; + if(!isOkayToShoot){ + motor[feeder] = 0; + loadFireTimer(); } - motor[feeder] = 0; - wait1Msec(waitTime); - motor[feeder] = 127; - wait1Msec(300); - motor[feeder] = 0; + else + motor[feeder] = 127; } } From bb94404f3e2111133ba14b24549512b0ed1b1a43 Mon Sep 17 00:00:00 2001 From: Jonathan Damico Date: Mon, 12 Oct 2015 21:35:59 -0700 Subject: [PATCH 2/3] should work --- 2016CWS8.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/2016CWS8.c b/2016CWS8.c index 97061de..356b64a 100644 --- a/2016CWS8.c +++ b/2016CWS8.c @@ -24,7 +24,7 @@ int motorSpeed = 0; //float velocity; int waitTime = 270; -bool isOkayToShoot; +bool isOkayToShoot = true; void speedUpFlywheel(){ while(motorSpeed < 90){ @@ -91,22 +91,21 @@ task drive(){ } } -task loadFireTimer () { - isOkayToShoot = false; - wait1Msec(waitTime); - isOkayToShoot = true; +task timeCheck () { + while(!SensorValue(ballHigh)) } task loadFire(){ // make this shit simpler while(true){ + clearTimer(T1); while(!SensorValue(ballHigh)) motor[feeder] = 127; - if(!isOkayToShoot){ - motor[feeder] = 0; - loadFireTimer(); + while(SensorValue(ballHigh)) { + if(time1[T1] < waitTime) + motor[feeder] = 0; + else + motor[feeder] = 127; } - else - motor[feeder] = 127; } } From 698575ec46f30d8ad9c6b0853b4a31330a81e55f Mon Sep 17 00:00:00 2001 From: Jonathan Damico Date: Mon, 12 Oct 2015 21:36:55 -0700 Subject: [PATCH 3/3] get rid of time check --- 2016CWS8.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/2016CWS8.c b/2016CWS8.c index 356b64a..950ff11 100644 --- a/2016CWS8.c +++ b/2016CWS8.c @@ -91,10 +91,6 @@ task drive(){ } } -task timeCheck () { - while(!SensorValue(ballHigh)) -} - task loadFire(){ // make this shit simpler while(true){ clearTimer(T1);