From 699b0e429c1923acdd1c19c6ef22952f3932f530 Mon Sep 17 00:00:00 2001 From: Thomas O Fredericks Date: Thu, 11 Jan 2024 11:47:09 -0500 Subject: [PATCH] Update README.md --- README.md | 33 +++++++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8eb0dec..c5f83b8 100644 --- a/README.md +++ b/README.md @@ -152,10 +152,39 @@ void loop() { | `unsigned long` `currentDuration()` | Returns the duration in milliseconds of the current state. Is reset to 0 when the state changes. | | `bool` `changed()` | Returns true if the state changed on last update. | | `bool` `read()` | Returns the pin's state (HIGH or LOW). | -| `bool` `fell()` | Returns true if pin signal transitions from high to low. | -| `bool` `rose()` | Returns true if pin signal transitions from low to high. | +| `bool` `fell()` | Returns true if pin signal transitions from high to low since the last update. | +| `bool` `rose()` | Returns true if pin signal transitions from low to high since the last update. | +### Bounce + +| Method | Description | +| --------------- | --------------- | +| `Bounce()` | Create an instance of the Bounce class. | +| `void` `update()` | Updates the pin's state. 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()` for each Bounce instance once per `loop()`. | +| `void` `attach(int pin, int mode)` | Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT). | +| `int` `getPin()` | Return pin that this instance is attached to. | +| `void` `interval ( uint16_t interval_millis )` | Sets the debounce interval in milliseconds. | +| `unsigned long` `previousDuration()` | Returns the duration in milliseconds of the previous state. | +| `unsigned long` `currentDuration()` | Returns the duration in milliseconds of the current state. Is reset to 0 when the state changes. | +| `bool` `changed()` | Returns true if the state changed on last update. | +| `bool` `read()` | Returns the pin's state (HIGH or LOW). | +| `bool` `fell()` | Returns true if pin signal transitions from high to low since the last update. | +| `bool` `rose()` | Returns true if pin signal transitions from low to high since the last update. | + +### Debouncer + +| Method | Description | +| --------------- | --------------- | +| `Debouncer()` | Create an instance of the Debouncer class.| +| `void` `update()` | Updates the pin's state. 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()` for each Bounce instance once per `loop()`. | +| `void` `interval ( uint16_t interval_millis )` | Sets the debounce interval in milliseconds. | +| `unsigned long` `previousDuration()` | Returns the duration in milliseconds of the previous state. | +| `unsigned long` `currentDuration()` | Returns the duration in milliseconds of the current state. Is reset to 0 when the state changes. | +| `bool` `changed()` | Returns true if the state changed on last update. | +| `bool` `read()` | Returns the pin's state (HIGH or LOW). | +| `bool` `fell()` | Returns true if pin signal transitions from high to low since the last update. | +| `bool` `rose()` | Returns true if pin signal transitions from low to high since the last update. | ## GITHUB PAGE (SOURCE CODE)