From dc43826c6c4b1852d6ad85b601e5ef10e82eb25d Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sat, 20 Sep 2014 20:19:30 +1000 Subject: [PATCH] Add support for 60-2 in the stim --- reference/stim/stim.ino | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/reference/stim/stim.ino b/reference/stim/stim.ino index 642bcde1..083d512c 100644 --- a/reference/stim/stim.ino +++ b/reference/stim/stim.ino @@ -7,8 +7,8 @@ #define MPH_PIN 12 #define POT_PIN A0 -#define teeth 36 -#define missingTeeth 1 +#define teeth 60 +#define missingTeeth 2 #define PULSE_DURATION 50 @@ -30,7 +30,12 @@ void setup() actualTeeth = teeth - missingTeeth; - if(actualTeeth == 35) + if(actualTeeth == 58) + { + MAX_DELAY = 3500; + MIN_DELAY = 130; + } + else if(actualTeeth == 35) { MAX_DELAY = 4000; MIN_DELAY = 29; @@ -133,7 +138,7 @@ void loop() } } // simulate the missing tooth next - delayMicroseconds( (pulse_gap) ); + delayMicroseconds( (pulse_gap * missingTeeth) ); } // end main loop version 7 , now perfect 800 rpm to 5000