32 #if defined(ARDUINO) && ARDUINO >= 100 95 void attach(
int pin,
int mode);
110 void interval(uint16_t interval_millis);
171 unsigned long previous_millis;
172 uint16_t interval_millis;
175 unsigned long stateChangeLastTime;
177 virtual bool readCurrentState() {
return digitalRead(pin); }
178 virtual void setPinMode(
int pin,
int mode) {
179 #if defined(ARDUINO_STM_NUCLEO_F103RB) || defined(ARDUINO_GENERIC_STM32F103C) 180 pinMode(pin, (WiringPinMode)mode);
187 inline void changeState();
188 inline void setStateFlag(
const uint8_t flag) {state |= flag;}
189 inline void unsetStateFlag(
const uint8_t flag) {state &= ~flag;}
190 inline void toggleStateFlag(
const uint8_t flag) {state ^= flag;}
191 inline bool getStateFlag(
const uint8_t flag) {
return((state & flag) != 0);}
bool read()
Returns the pin's state (HIGH or LOW).
Definition: Bounce2.cpp:127
void interval(uint16_t interval_millis)
Sets the debounce interval in milliseconds.
Definition: Bounce2.cpp:36
bool fallingEdge()
Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...
Definition: Bounce2.h:148
void attach(int pin, int mode)
Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT).
Definition: Bounce2.cpp:31
bool fell()
Returns true if pin signal transitions from high to low.
Definition: Bounce2.cpp:137
bool update()
Updates the pin's state.
Definition: Bounce2.cpp:41
bool risingEdge()
Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...
Definition: Bounce2.h:144
unsigned long duration()
Returns the duration in milliseconds of the current state.
Definition: Bounce2.cpp:116
Bounce(uint8_t pin, unsigned long interval_millis)
Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...
Definition: Bounce2.h:152
Bounce()
Create an instance of the Bounce class.
Definition: Bounce2.cpp:11
bool rose()
Returns true if pin signal transitions from low to high.
Definition: Bounce2.cpp:132