From f62ed11821be24f0b7dc0cd46e5434616f682383 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Sun, 1 May 2016 22:03:32 +1000 Subject: [PATCH] More improvements on the dual wheel decoder --- decoders.ino | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/decoders.ino b/decoders.ino index 9269624..b9156bf 100644 --- a/decoders.ino +++ b/decoders.ino @@ -207,13 +207,19 @@ void triggerSec_DualWheel() if(!currentStatus.hasSync) { toothCurrentCount = 0; + + toothOneTime = micros(); + toothOneMinusOneTime = toothOneTime - 6000000; //Fixes RPM at 10rpm until a full revolution has taken place + currentStatus.hasSync = true; } } int getRPM_DualWheel() { - return stdGetRPM(); + if( !currentStatus.hasSync || toothCurrentCount == 0 ) { return 0; } + if(currentStatus.RPM < configPage2.crankRPM) { return crankingGetRPM(configPage2.triggerTeeth); } + return stdGetRPM(); } int getCrankAngle_DualWheel(int timePerDegree)