Skip to content

Commit

Permalink
Fix frequency of compression waves when a 720 degree pattern is used
Browse files Browse the repository at this point in the history
  • Loading branch information
noisymime committed May 14, 2024
1 parent 3ff5275 commit 1327ba3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ardustim/ardustim/ardustim.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1327ba3

Please sign in to comment.