From 1327ba3682fa87bd6179285469152d96ceddcf8d Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Tue, 14 May 2024 13:16:15 +1000 Subject: [PATCH] Fix frequency of compression waves when a 720 degree pattern is used --- ardustim/ardustim/ardustim.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ardustim/ardustim/ardustim.ino b/ardustim/ardustim/ardustim.ino index 1768ca7..cebb252 100644 --- a/ardustim/ardustim/ardustim.ino +++ b/ardustim/ardustim/ardustim.ino @@ -367,7 +367,7 @@ uint16_t calculateCurrentCrankAngle() if(cycleDuration == 0) { return 0; } uint32_t cycleTime = micros() - cycleStartTime; - if( pgm_read_byte(&Wheels[config.wheel].wheel_degrees) == 720 ) { cycleTime = cycleTime / 2; } + if( Wheels[config.wheel].wheel_degrees == 720 ) { cycleTime = cycleTime * 2; } uint16_t tmpCrankAngle = ((cycleTime * 360U) / cycleDuration); tmpCrankAngle += config.compressionOffset;