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

Function handleButtonPress

nRFBox_V2/spoofer.cpp:367–380  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

365
366
367void handleButtonPress(int pin, void (*callback)()) {
368 int reading = digitalRead(pin);
369
370 if (reading == LOW) {
371 unsigned long currentTime = millis();
372 delay(300);
373 updateDisplay();
374
375 if ((currentTime - lastDebounceTime) > debounceDelay) {
376 callback();
377 lastDebounceTime = currentTime;
378 }
379 }
380}
381
382void changeDeviceTypeNext() {
383 deviceType++;

Callers 1

spooferLoopFunction · 0.70

Calls 1

updateDisplayFunction · 0.70

Tested by

no test coverage detected