[chronojump] ForceSensor-LCD. Renamed red and blue buttons
- From: Xavier Padullés <xpadulles src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [chronojump] ForceSensor-LCD. Renamed red and blue buttons
- Date: Mon, 29 Nov 2021 09:24:50 +0000 (UTC)
commit 3dbc080ab23a5f9782f6cefa01382aa9ddf48d0c
Author: Xavier Padullés <x padulles gmail com>
Date: Thu Nov 25 16:15:37 2021 +0100
ForceSensor-LCD. Renamed red and blue buttons
arduino/ForceSensorLCD/ForceSensorLCD.ino | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
---
diff --git a/arduino/ForceSensorLCD/ForceSensorLCD.ino b/arduino/ForceSensorLCD/ForceSensorLCD.ino
index 97884f04a..0bb88b12d 100644
--- a/arduino/ForceSensorLCD/ForceSensorLCD.ino
+++ b/arduino/ForceSensorLCD/ForceSensorLCD.ino
@@ -78,11 +78,11 @@ unsigned long totalTime = 0;
unsigned long syncTime = 0;
unsigned int samples = 0;
-const int button1Pin = 6;
-bool button1State;
+const int redButtonPin = 6;
+bool redButtonState;
-const int button2Pin = 13;
-bool button2State;
+const int blueButtonPin = 13;
+bool blueButtonState;
float voltage;
@@ -116,15 +116,15 @@ bool rcaState = digitalRead(rcaPin);
bool lastRcaState = rcaState;
void setup() {
- pinMode(button1Pin, INPUT);
- pinMode(button2Pin, INPUT);
+ pinMode(redButtonPin, INPUT);
+ pinMode(blueButtonPin, INPUT);
analogWrite(6, 20);
lcd.begin(16, 2);
Serial.begin(115200);
attachInterrupt(digitalPinToInterrupt(rcaPin), changingRCA, CHANGE);
- if (button1State == 0) {
+ if (redButtonState == 0) {
lcd.setCursor(2, 0);
lcd.print("CHRONOJUMP");
lcd.setCursor(2, 1);
@@ -158,8 +158,8 @@ void setup() {
void loop()
{
- button2State = digitalRead(button2Pin);
- if (button2State == 1) {
+ blueButtonState = digitalRead(blueButtonPin);
+ if (blueButtonState == 1) {
lcd.clear();
lcd.setCursor(3, 0);
lcd.print("Taring...");
@@ -175,7 +175,7 @@ void loop()
// lcd.print("Press Start");
}
- button1State = digitalRead(button1Pin);
+ redButtonState = digitalRead(redButtonPin); //Red button
if(sendSyncTime) {
Serial.print("sync:");
@@ -240,11 +240,11 @@ void loop()
// end_capture();
// }
}
- if (button1State) {
+ if (redButtonState) {
end_capture();
}
} else if (!capturing) {
- if (button1State) {
+ if (redButtonState) {
start_capture();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]