summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbel Tim <abel.tim.t@gmail.com>2026-02-08 12:32:47 +0100
committerAbel Tim <abel.tim.t@gmail.com>2026-02-08 12:32:47 +0100
commit42dfd646a14c5d59fb5bf47c5453c6b7b64f63cf (patch)
tree4b95efbacd8fc7aec04e4745e8cb28cbaf19bd8c
parent8377d08b63654a232be43938ca9ffc09f9be3f29 (diff)
downloadrobotica-42dfd646a14c5d59fb5bf47c5453c6b7b64f63cf.tar.gz
robotica-42dfd646a14c5d59fb5bf47c5453c6b7b64f63cf.zip
im a idiot
had m1encSP to < 0 give error but a motor can also be not moving no < 0 so
-rw-r--r--code/debug/motors/PID/PID.ino2
1 files changed, 1 insertions, 1 deletions
diff --git a/code/debug/motors/PID/PID.ino b/code/debug/motors/PID/PID.ino
index 1e86a5d..86a32ee 100644
--- a/code/debug/motors/PID/PID.ino
+++ b/code/debug/motors/PID/PID.ino
@@ -73,7 +73,7 @@ void updateSpeed() {
//6 interupts per rotation and interuptDuration but in seconds
m1encSP = (m1enc / 6.0) / (interuptDuration/1000.0);
m1enc = 0;
- if (m1encSP < 1 || isnan(m1encSP)) {
+ if (m1encSP < 0 || isnan(m1encSP)) {
m1encSP = 0;
tone(buzzer, 1000);
Serial.println(" ___________________________");