From 3cba814333829daa431f663cf278315f56b47515 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Sun, 15 Nov 2015 19:53:06 -0500 Subject: eh? --- src/auto.c | 33 ++++++++++++++------------------- 1 file changed, 14 insertions(+), 19 deletions(-) (limited to 'src/auto.c') diff --git a/src/auto.c b/src/auto.c index 33204f9..3c8f2ef 100644 --- a/src/auto.c +++ b/src/auto.c @@ -1,6 +1,6 @@ #include -#define TARGET_RPM 1970 +#define TARGET_SPEED 65 static unsigned int time; @@ -10,37 +10,32 @@ void autoDelay(unsigned int ms){ } void autonomous(){ - static int trpm; - static double rpm; - static char cs; + static char speed = 0; time = 15000; - cs = rpm = trpm = 0; do{ - cs+=cs<100?10:0; + speed+=10; - motorSet(CANNON1,cs); - motorSet(CANNON2,cs); - motorSet(CANNON3,cs); - motorSet(CANNON4,cs); + motorSet(CANNON1,speed); + motorSet(CANNON2,speed); + motorSet(CANNON3,speed); + motorSet(CANNON4,speed); - autoDelay(800); + autoDelay(200); - imeGetVelocity(ICANNON3,&trpm); - rpm=abs(trpm)/24.5L; - rpm*=25.0L; + }while(speed