Seperated debounce read function for buttons which are normally high and normally low

This commit is contained in:
2025-10-31 14:39:00 +01:00
parent 194e608f9e
commit 2991f58c7d
3 changed files with 58 additions and 22 deletions

View File

@@ -4,10 +4,13 @@ class Reader
{
private:
unsigned long lastDebounceTime = 0;
bool lastButtonState = LOW;
bool buttonState = HIGH;
bool lastButtonStateNO = LOW;
bool buttonStateNO = HIGH;
bool lastButtonStateNC = HIGH;
bool buttonStateNC = LOW;
int lastPin;
public:
bool debounceRead(int buttonPin);
bool debounceReadNO(int buttonPin);
bool debounceReadNC(int buttonPin);
};