This commit is contained in:
talksik
2024-01-25 13:53:51 -08:00
parent aac5a8ed06
commit 3cfc0022e0
+3 -1
View File
@@ -52,6 +52,9 @@ int main(int argc, char *argv[])
while (1) while (1)
{ {
printf("Button state: %d\n", digitalRead(BUTTON_PIN));
continue;
if (digitalRead(BUTTON_PIN) == LOW && !buttonPressed) if (digitalRead(BUTTON_PIN) == LOW && !buttonPressed)
{ {
printf("Button pressed\n"); printf("Button pressed\n");
@@ -100,7 +103,6 @@ int main(int argc, char *argv[])
} }
else else
{ {
printf("UNpressed\n");
buttonPressed = false; buttonPressed = false;
continue; continue;
} }