Files
Arduino-Volume-Controller/include/commonFunctions.h
Lyubomir Penev 0cc6f49130
All checks were successful
Generate Documentation / build (push) Successful in 21s
Added comments
2025-11-01 19:20:01 +01:00

31 lines
686 B
C++

#pragma once
class Reader
{
private:
unsigned long lastDebounceTime = 0;
bool lastButtonStateNO = LOW;
bool buttonStateNO = HIGH;
bool lastButtonStateNC = HIGH;
bool buttonStateNC = LOW;
int lastPin;
public:
/**
* @brief Function used to read state of a normally open(LOW) button
*
* @param buttonPin The pin of the button
* @return true
* @return false
*/
bool debounceReadNO(int buttonPin);
/**
* @brief Function used to read state of a normally closed(HIGH) button
*
* @param buttonPin The pin of the button
* @return true
* @return false
*/
bool debounceReadNC(int buttonPin);
};