[chronojump/michrolab] Fixed first rca change detection



commit c5c9cf531d94bc72e8680a6749a8c4eccaee9a77
Author: Xavier Padullés <testing chronojump org>
Date:   Fri Jul 15 09:52:48 2022 +0200

    Fixed first rca change detection

 arduino/michrolab/michrolab.ino | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/arduino/michrolab/michrolab.ino b/arduino/michrolab/michrolab.ino
index 9ab4b7c36..e3618f5af 100644
--- a/arduino/michrolab/michrolab.ino
+++ b/arduino/michrolab/michrolab.ino
@@ -737,6 +737,7 @@ void changingRCA() {
   rcaTime = totalTime;
   rcaState = digitalRead(rcaPin);
   rcaTimer.begin(rcaDebounce, 2000);
+  //Serial.print("-");
 }
 
 //After the debounce time the state of the RCA is checked again to see if it has changed
@@ -1340,8 +1341,7 @@ void startJumpsCapture()
   float maxJump = 0;
   int totalJumps = 0;
   float graphRange = 100;
-  rcaState = digitalRead(rcaPin);
-  lastRcaState = rcaState;
+  lastRcaState = !digitalRead(rcaPin);
   rcaFlag = false;
   float flightTime = 0;
   bool firstContact = true;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]