#include <Bounce2.h>
|
| | Bounce () |
| |
| void | attach (int pin, int mode) |
| |
| void | attach (int pin) |
| |
| void | interval (uint16_t interval_millis) |
| |
| bool | update () |
| |
| bool | read () |
| |
| bool | fell () |
| |
| bool | rose () |
| |
|
bool | risingEdge () |
| |
|
bool | fallingEdge () |
| |
|
| Bounce (uint8_t pin, unsigned long interval_millis) |
| |
| unsigned long | duration () |
| |
|
|
virtual bool | readCurrentState () |
| |
|
virtual void | setPinMode (int pin, int mode) |
| |
|
|
unsigned long | previous_millis |
| |
|
uint16_t | interval_millis |
| |
|
uint8_t | state |
| |
|
uint8_t | pin |
| |
|
unsigned long | stateChangeLastTime |
| |
◆ Bounce()
Create an instance of the Bounce class.
◆ attach() [1/2]
| void Bounce::attach |
( |
int |
pin, |
|
|
int |
mode |
|
) |
| |
Attach to a pin and sets that pin's mode (INPUT/INPUT_PULLUP/OUTPUT)
◆ attach() [2/2]
| void Bounce::attach |
( |
int |
pin | ) |
|
Attach to a pin for advanced users. Only attach the pin this way once you have previously set it up. Otherwise use attach(int pin, int mode).
◆ duration()
| unsigned long Bounce::duration |
( |
| ) |
|
Returns the duration in milliseconds of the current state. Is reset to 0 once the pin rises or falls.
◆ fell()
Returns true if pin signal transitions from high to low.
◆ interval()
| void Bounce::interval |
( |
uint16_t |
interval_millis | ) |
|
Sets the debounce interval in milliseconds.
◆ read()
Returns the pin's state (HIGH or LOW).
◆ rose()
Returns true if pin signal transitions from low to high.
◆ update()
Updates the pin's state. Returns 1 if the state changed. Returns 0 if the state did not change. Because Bounce does not use interrupts, you have to "update" the object before reading its value and it has to be done as often as possible (that means to include it in your loop()). Only call update() once per loop().
The documentation for this class was generated from the following files: