From d96e0d30b3bd45e6a76cbd14da6eef2411e5642d Mon Sep 17 00:00:00 2001 From: mattmcw Date: Mon, 22 Jan 2024 11:42:21 -0500 Subject: [PATCH] Check against rotations. --- ino/motor_encoder_poc/motor_encoder_poc.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ino/motor_encoder_poc/motor_encoder_poc.ino b/ino/motor_encoder_poc/motor_encoder_poc.ino index 8f3ff49..d180022 100644 --- a/ino/motor_encoder_poc/motor_encoder_poc.ino +++ b/ino/motor_encoder_poc/motor_encoder_poc.ino @@ -87,7 +87,7 @@ void loop() { } rotations = (int) floor((float) pos / (float) maxPulses); - if (pos != lastRotationPosition) { + if (rotations != lastRotationPosition) { lastRotationPosition = rotations; frames = rotations * framesPerRotation;