MCPcopy Create free account
hub / github.com/cifertech/nRFBox / checkButtons

Function checkButtons

VScode Platformio/src/scanner.cpp:171–188  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171void checkButtons() {
172 static unsigned long lastDebounceTime1 = 0;
173 static int lastButtonState1 = LOW;
174
175 int buttonState1 = digitalRead(BUTTON);
176
177 if (buttonState1 != lastButtonState1) {
178 lastDebounceTime1 = millis();
179 }
180 if ((millis() - lastDebounceTime1) > 50) {
181 if (buttonState1 == LOW) {
182 if (filled == 'F') filled = 'D';
183 else filled = 'F';
184 Serial.println(filled);
185 }
186 }
187 lastButtonState1 = buttonState1;
188}
189
190
191void scannerSetup(){

Callers 1

scannerLoopFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected