Seperated debounce read function for buttons which are normally high and normally low
This commit is contained in:
@@ -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);
|
||||
};
|
||||
Reference in New Issue
Block a user