[chronojump: 3/6] Testing triggers
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump: 3/6] Testing triggers
- Date: Tue, 11 May 2021 09:27:11 +0000 (UTC)
commit 5b0b0969a2f27a12abe42e6c77b43e387af83b77
Author: Xavier Padullés <x padulles gmail com>
Date: Mon May 10 13:34:14 2021 +0200
Testing triggers
arduino/raceAnalyzer/raceAnalyzer.ino | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/arduino/raceAnalyzer/raceAnalyzer.ino b/arduino/raceAnalyzer/raceAnalyzer.ino
index d27600de..ac8faa2a 100644
--- a/arduino/raceAnalyzer/raceAnalyzer.ino
+++ b/arduino/raceAnalyzer/raceAnalyzer.ino
@@ -238,8 +238,9 @@ void changingA() {
void changingRCA() {
//TODO: Check the overflow of the lastTriggerTime
- sampleTime = micros();
detachInterrupt(digitalPinToInterrupt(rcaPin));
+ sampleTime = micros();
+ Serial.println("RCAInterrupt");
MsTimer2::start();
triggerTime = sampleTime;
rcaState = digitalRead(rcaPin);
@@ -269,11 +270,12 @@ void changingRCA() {
void rcaDebounce()
{
MsTimer2::stop();
- if (digitalRead(rcaPin) != rcaState)
+ bool currentRcaState = digitalRead(rcaPin);
+ if (currentRcaState != rcaState)
{
sampleTime = micros();
triggerTime = sampleTime;
- rcaState = !rcaState;
+ rcaState = currentRcaState;
data.encoderDisplacement = encoderDisplacement;
encoderDisplacement = 0;
@@ -285,7 +287,7 @@ void rcaDebounce()
procesSample = true;
isTrigger = true;
// Serial.print(encoderDisplacement);
-// Serial.print("\tTimmer\t");
+ Serial.println("RCA Changed during debounceTime");
// Serial.println(rcaState);
}
// Serial.println("Debounce");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]