Compare commits

...
Author SHA1 Message Date
Thomas O Fredericks 371e2cff35 Update bounce_m5stack_atom_key-unit.ino 2024-01-11 12:24:10 -05:00
Thomas O Fredericks 9276539335 Added an example for the m5stack atom 2024-01-11 12:10:11 -05:00
Thomas O Fredericks cda0200633 Update README.md 2024-01-11 11:57:37 -05:00
Thomas O Fredericks ff821cb300 Removed old documentation and updated version 2024-01-11 11:53:14 -05:00
Thomas O Fredericks b7cd534fb7 Update README.md 2024-01-11 11:50:52 -05:00
Thomas O Fredericks 699b0e429c Update README.md 2024-01-11 11:47:09 -05:00
Thomas O Fredericks 71568702f2 Update README.md 2024-01-11 11:43:46 -05:00
Thomas O Fredericks d2c9f1673c Updated the documentation 2024-01-11 11:40:42 -05:00
Thomas O Fredericks ee74d73978 Merge pull request #90 from WAMaker/fix/typo
fix typo
2022-09-16 10:31:33 -04:00
WAMaker d744e0690f chore: fix typo 2022-09-14 23:16:39 +08:00
Thomas O Fredericks 152a64231a Changed documention on where to put defines 2022-03-28 19:56:01 -04:00
Thomas O Fredericks 79db9f0016 Added back duration but as deprecated and updated documentation 2022-03-21 10:04:38 -04:00
Thomas O Fredericks 5e100280c5 Updated Doxygen docs 2021-08-03 11:01:07 -04:00
Thomas O Fredericks 2ba0be8f83 Changed duration() to currentDuration() and added examples 2021-08-03 10:59:00 -04:00
Thomas O Fredericks 28afcafa6a Updated doc to 2.60 2021-06-29 01:30:28 -04:00
Thomas O Fredericks 1645b897c8 Added getPin 2021-06-28 16:41:16 -04:00
Thomas O Fredericks 68dc6f7830 Adding a little documentation 2021-06-28 16:33:17 -04:00
Thomas O Fredericks f87ba5ba9f Update library.properties 2021-03-04 15:53:16 -05:00
Thomas O Fredericks 246096ae96 Update library.json 2021-03-04 15:53:02 -05:00
Thomas O Fredericks 1ce882f949 Merge pull request #78 from DanForever/master
Made the bounce2 library const correct
2021-03-04 15:49:53 -05:00
Dan Neve a132f4ab43 Made the bounce2 library const correct 2021-03-04 19:14:11 +01:00
Thomas O Fredericks e89801c2dd Merge pull request #77 from michaelcress/master
Correcting spelling error in README file
2021-03-04 00:18:06 -05:00
Michael Cress 744a957b76 Correcting spelling error 2021-03-03 05:59:07 -05:00
Thomas O Fredericks cd87a100be Delete Bounce2NameSpace.h 2021-01-29 18:45:51 -05:00
Thomas O Fredericks 6f244834a4 Merge pull request #74 from mkfrey/master
Add a component.mk file to allow using this project as a component of esp-idf (< 4.0).
2021-01-29 13:21:46 -05:00
Thomas O Fredericks 5a481c6922 Moving Button to Bounce2 namespace 2021-01-23 18:05:58 -05:00
Markus Frey 4207a8dd17 Add component.mk 2021-01-19 17:35:14 +01:00
Thomas O Fredericks eb5ab9fad8 Update README.md 2020-09-29 10:33:17 -04:00
Thomas O Fredericks c445bbc7a7 Update README.md 2020-09-29 10:32:59 -04:00
Thomas O Fredericks c012c6c042 Merge pull request #67 from jamesmyatt/better_button
Methods to determine whether Button is currently pressed
2020-09-03 09:28:58 -04:00
James Myatt 83bc18e245 Revert "Reuse state attribute for pressed state"
This reverts commit 9babb4fc38.
2020-08-26 13:53:35 +01:00
Thomas O Fredericks 3a88a924f2 Fixed more "sloppy programming" 2020-08-25 14:24:38 -04:00
Thomas O Fredericks fd99238112 Fixed "sloppy programming" in main examples 2020-08-25 14:23:11 -04:00
James Myatt 9babb4fc38 Reuse state attribute for pressed state 2020-08-25 13:59:55 +01:00
James Myatt 878f86bf1c Add isPressed and getPressedState methods 2020-08-25 13:54:33 +01:00
Thomas O Fredericks 59d3c66c56 Removed Todo 2020-08-08 10:57:24 -04:00
Thomas O Fredericks 08392e0f01 Removed Todo 2020-08-08 10:56:06 -04:00
Thomas O Fredericks 3ddefb4ba4 Updated documentation 2020-08-08 10:21:57 -04:00
Thomas O Fredericks 172e3e0835 Merge pull request #63 from thomasfredericks/Button
Button
2020-08-06 17:42:30 -04:00
Thomas O Fredericks f51b22b708 Updated documentation 2020-08-06 17:37:25 -04:00
Thomas O Fredericks 1a6552ffe5 New Debouncer class split from the hardware layer 2020-08-06 13:34:56 -04:00
Thomas O Fredericks 2b6be81dc1 Updated docs and version number 2020-05-21 16:03:08 -04:00
Thomas O Fredericks 6147a34058 Changed the default stateForPressed and fixed example 2020-05-21 15:45:52 -04:00
Thomas O Fredericks 1af864b0bd Added a Button class 2020-05-19 14:06:37 -04:00
Thomas O Fredericks cf32eda85e v2.53 2020-02-26 14:42:35 -05:00
Thomas O Fredericks a57ba4c66a Update library.properties 2020-02-26 14:41:36 -05:00
Thomas O Fredericks 85d80fe400 Merge pull request #58 from fpistm/patch-1
Generic Arduino_STM32 support
2020-02-20 18:48:35 -05:00
Frederic Pillon 14f9c5c4a6 Generic Arduino_STM32 support
When BluePill support have been introduced, it was not enough generic
https://github.com/thomasfredericks/Bounce2/pull/35

Board specific definition have been used instead of the generic core one:
`ARDUINO_ARCH_STM32F1`
2020-02-14 08:05:43 +01:00
Thomas O Fredericks 9335056c46 Merge pull request #57 from dwrobel/dw-fix-compilation-error
Fix compilation error
2019-11-26 08:08:29 -05:00
Damian Wrobel 26e216c98d Fix compilation error
libraries/Bounce2/src/Bounce2.h:209:10: error: extra qualification 'Bounce::' on member 'changed' [-fpermissive]
  209 |     bool Bounce::changed( ) { return getStateFlag(CHANGED_STATE); }
      |          ^~~~~~

Regression introduced in 01e6fc9398

Signed-off-by: Damian Wrobel <dwrobel@ertelnet.rybnik.pl>
2019-11-25 14:42:05 +01:00
Thomas O Fredericks 6228e09451 Moved literals to header as suggested by MartinNel 2019-11-21 22:09:13 -05:00
Thomas O Fredericks 51032991ac Update Bounce2.h 2019-11-07 09:33:43 -05:00
Thomas O Fredericks de69c15225 Merge pull request #55 from thomasfredericks/Testing
Added a changed() function
2019-11-07 09:30:31 -05:00
Thomas O Fredericks 220a287467 Made changed() public instead of protected 2019-10-06 13:01:12 -04:00
Thomas O Fredericks 01e6fc9398 Added a protected changed() function 2019-10-05 16:14:33 -04:00
Thomas O Fredericks 3e4738b4ef Added Bounce2 as a KEYWORD1 2019-05-23 10:47:16 -04:00
Thomas O Fredericks 3706e16e4b Merge pull request #50 from trapper-/master
Fix extraneous @return in function comment
2019-02-06 19:22:17 -05:00
trapper- 9a275c4f96 Update Bounce2.h
Fix extraneous @return line in function comment
2019-02-06 14:30:05 +08:00
Thomas O Fredericks d422d7c054 Added previous duration 2018-09-11 10:09:57 -04:00
100 changed files with 929 additions and 7690 deletions
-2492
View File
File diff suppressed because it is too large Load Diff
+193 -55
View File
@@ -1,31 +1,208 @@
# BOUNCE 2
Debouncing library for Arduino and Wiring by Thomas Ouellet Fredericks with contributions from: Eric Lowry, Jim Schimpf, Tom Harkaway, Joachim Krüger and MrGradgrind.
Debouncing library for Arduino and Wiring by Thomas Ouellet Fredericks and many [contributors](https://github.com/thomasfredericks/Bounce2/graphs/contributors).
More about debouncing: http://en.wikipedia.org/wiki/Debounce#Contact_bounce
The mechanical part of buttons and switches vibrate slightly when closed or opened causing multiple undesired false states (similar to noise). This library filters out these undesired state changes. You can learn more about debouncing here:
* John Errington's Experiments with an Arduino : [Using digital inputs: Switch bounce and solutions to it](http://www.skillbank.co.uk/arduino/switchbounce.htm)
* Wikipedia article : http://en.wikipedia.org/wiki/Debounce#Contact_bounce
See the bottom of this page for a basic usage example and the "examples" folder for more.
## GITHUB PAGE
https://github.com/thomasfredericks/Bounce2
## DOCUMENTATION
The complete class documentation can be found in the "docs" folder or [online here](http://thomasfredericks.github.io/Bounce2/).
The library is composed of three classes:
* Bounce2::Button : The most feature rich class for deboucing hardware buttons. The one that most people will use.
* Debouncer : The code that does the actual debouncing. Only advanced users should play with this class.
* Bounce : This class links the Debouncer to a hardware pin on your board. It is odly named because it needs to be backward compatible to previous versions of this library.
# HAVE A QUESTION?
Please post your questions [here](http://forum.arduino.cc/index.php?topic=266132.0).
Please post your usage questions on the [Arduino Forums](https://forum.arduino.cc/latest).
# INSTALLATION & DOWNLOAD
Install through your software's Library Manager or download the latest version [here](https://github.com/thomasfredericks/Bounce2/archive/master.zip) and put the "Bounce2" folder in your "libraries" folder.
The original version of Bounce (Bounce 1) is included in the download but not supported anymore.
Please note that the original version of this library (Bounce 1) is included in the "extras" folder of the download but not supported anymore.
# BASIC USE
## ADD TO THE GLOBAL SPACE
```cpp
#include <Bounce2.h>
Bounce2::Button button = Bounce2::Button(); // INSTANTIATE A Bounce2::Button OBJECT
```
## CONFIGURE IN SETUP()
In the code sample below :
* Change *PIN* to the hardware pin of the button.
* Change *PIN_MODE* to `INPUT_PULLUP` if using an internal pullup, or `INPUT` if using an external pullup.
* Change *INTERVAL_IN_MS* to the debounce interval in millisecons. `5` is a good value.
* Change *PRESSED_STATE* to `LOW` if the button outputs a `LOW` when pressed, or to `HIGH` if the button outputs a `HIGH` when pressed.
```cpp
button.attach ( PIN , PIN_MODE );
button.interval( INTERVAL_IN_MS );
button.setPressedState( PRESSED_STATE );
```
# DEBOUNCE ALGORITHMS (FOR ADVANCED USERS)
## USE IN LOOP()
```cpp
// UPDATE THE BUTTON BY CALLING .update() AT THE BEGINNING OF THE LOOP:
button.update();
// IF THE BUTTON WAS PRESSED THIS LOOP:
if ( button.pressed() ) {
// DO SOMETHING IF THE BUTTON WAS PRESSED THIS LOOP...
}
```
# EXAMPLES
You can find many examples in the **examples** folder.
## EXAMPLE OF Bounce2::Button TOGGLING THE STATE OF A LED
```cpp
/*
DESCRIPTION
====================
This is an example of the Bounce2::Button class.
When the user presses a physical button, it toggles a LED on or off.
The Button class matches an electrical state to a physical action.
Use .setPressedState(LOW or HIGH) to set the detection state for when the button is pressed.
INSTRUCTIONS
====================
Set BUTTON_PIN to the pin attached to the button.
Set LED_PIN to the pin attached to a LED.
*/
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Button OBJECT
Bounce2::Button button = Bounce2::Button();
// WE WILL attach() THE BUTTON TO THE FOLLOWING PIN IN setup()
#define BUTTON_PIN 39
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
//#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
#define LED_PIN 13
// SET A VARIABLE TO STORE THE LED STATE
bool ledState = LOW;
void setup() {
// BUTTON SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR BUTTON HAS AN INTERNAL PULL-UP
// button.attach( BUTTON_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR BUTTON USES AN EXTERNAL PULL-UP
button.attach( BUTTON_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
button.interval(5);
// INDICATE THAT THE LOW STATE CORRESPONDS TO PHYSICALLY PRESSING THE BUTTON
button.setPressedState(LOW);
// LED SETUP
pinMode(LED_PIN,OUTPUT);
digitalWrite(LED_PIN,ledState);
}
void loop() {
// UPDATE THE BUTTON
// YOU MUST CALL THIS EVERY LOOP
button.update();
if ( button.pressed() ) {
// TOGGLE THE LED STATE :
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState);
}
}
```
# DOCUMENTATION
## Bounce2::Button
The `Bounce2::Button` class extends `Bounce` and adds `pressed()` and `released()` methods. It is the most feature rich class of the library.
| Method | Description |
| --------------- | --------------- |
| `Button()` | Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical level. |
| `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` `setPressedState(bool state)` | Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default, the pressed state is matched to a HIGH electrical level. |
| `bool` `getPressedState()` | Get the electrical state (HIGH/LOW) that corresponds to a physical press. |
| `bool ` `isPressed() ` | Returns true if the button **is** currently pressed. |
| `bool ` `pressed()` | Returns true if the button **was** pressed |
| `bool ` `released()` | Returns true if the button **was** released |
| `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. |
## Bounce
The `Bounce` class extends `Debouncer` and links it to a hardware pin. This class is odly named, but it will be kept that so it stays compatible with previous code.
| 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
The `Debouncer` class. Just the debouncing code separated from all harware.
| 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)
https://github.com/thomasfredericks/Bounce2
# ALTERNATE DEBOUNCE ALGORITHMS FOR **ADVANCED** USERS AND SPECIFIC CASES
## STABLE INTERVAL
@@ -36,7 +213,7 @@ By default, the Bounce library uses a stable interval to process the debouncing.
## LOCK-OUT INTERVAL
By defining "#define BOUNCE_LOCK_OUT" in "Bounce.h" (or in your code before including "Bounce.h") you can activate an alternative debouncing method. This method is a lot more responsive, but does not cancel noise.
By defining "#define BOUNCE_LOCK_OUT" in "Bounce.h" you can activate an alternative debouncing method. This method is a lot more responsive, but does not cancel noise.
```
#define BOUNCE_LOCK_OUT
@@ -44,10 +221,9 @@ By defining "#define BOUNCE_LOCK_OUT" in "Bounce.h" (or in your code before incl
![](https://raw.github.com/thomasfredericks/Bounce-Arduino-Wiring/master/extras/BouncySwitch_lockout.png)
## WITH PROMPT DETECTION
By defining "#define BOUNCE_WITH_PROMPT_DETECTION" in "Bounce.h" (or in your code before including "Bounce.h") you can activate an alternative debouncing method. Button state changes are available immediately so long as the previous state has been stable for the timeout period. Otherwise the state will be updated as soon as the timeout period allows.
By defining "#define BOUNCE_WITH_PROMPT_DETECTION" in "Bounce.h" you can activate an alternative debouncing method. Button state changes are available immediately so long as the previous state has been stable for the timeout period. Otherwise the state will be updated as soon as the timeout period allows.
* Able to report acurate switch time normally with no delay.
* Use when accurate switch transition timing is important.
@@ -56,42 +232,4 @@ By defining "#define BOUNCE_WITH_PROMPT_DETECTION" in "Bounce.h" (or in your cod
#define BOUNCE_WITH_PROMPT_DETECTION
```
# BASIC EXAMPLE
```cpp
// This example toggles the debug LED (pin 13) on or off
// when a button on pin 2 is pressed.
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#define BUTTON_PIN 2
#define LED_PIN 13
int ledState = LOW;
Bounce debouncer = Bounce(); // Instantiate a Bounce object
void setup() {
debouncer.attach(BUTTON_PIN,INPUT_PULLUP); // Attach the debouncer to a pin with INPUT_PULLUP mode
debouncer.interval(25); // Use a debounce interval of 25 milliseconds
pinMode(LED_PIN,OUTPUT); // Setup the LED
digitalWrite(LED_PIN,ledState);
}
void loop() {
debouncer.update(); // Update the Bounce instance
if ( debouncer.fell() ) { // Call code if button transitions from HIGH to LOW
ledState = !ledState; // Toggle LED state
digitalWrite(LED_PIN,ledState); // Apply new LED state
}
}
```
File diff suppressed because one or more lines are too long
-78
View File
@@ -1,78 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Class List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here are the classes, structs, unions and interfaces with brief descriptions:</div><div class="directory">
<table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_bounce.html" target="_self">Bounce</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 676 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 147 B

@@ -1,74 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: bounce2buttons.ino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">bounce2buttons.ino</div> </div>
</div><!--header-->
<div class="contents">
<p>Example of two instances of the <a class="el" href="class_bounce.html">Bounce</a> class that switches the debug LED when either one of the two buttons is pressed.</p>
<div class="fragment"><div class="line"></div><div class="line">/* </div><div class="line"> DESCRIPTION</div><div class="line"> ====================</div><div class="line"> Simple example of the Bounce library that switches the debug LED when </div><div class="line"> either of 2 buttons are pressed.</div><div class="line"> */</div><div class="line"> </div><div class="line">// Include the Bounce2 library found here :</div><div class="line">// https://github.com/thomasfredericks/Bounce2</div><div class="line">#include &lt;Bounce2.h&gt;</div><div class="line"></div><div class="line">#define BUTTON_PIN_1 2</div><div class="line">#define BUTTON_PIN_2 3</div><div class="line"></div><div class="line"></div><div class="line">#define LED_PIN 13</div><div class="line"></div><div class="line">// Instantiate a Bounce object</div><div class="line">Bounce debouncer1 = Bounce(); </div><div class="line"></div><div class="line">// Instantiate another Bounce object</div><div class="line">Bounce debouncer2 = Bounce(); </div><div class="line"></div><div class="line">void setup() {</div><div class="line"></div><div class="line"> // Setup the first button with an internal pull-up :</div><div class="line"> pinMode(BUTTON_PIN_1,INPUT_PULLUP);</div><div class="line"> // After setting up the button, setup the Bounce instance :</div><div class="line"> debouncer1.attach(BUTTON_PIN_1);</div><div class="line"> debouncer1.interval(5); // interval in ms</div><div class="line"> </div><div class="line"> // Setup the second button with an internal pull-up :</div><div class="line"> pinMode(BUTTON_PIN_2,INPUT_PULLUP);</div><div class="line"> // After setting up the button, setup the Bounce instance :</div><div class="line"> debouncer2.attach(BUTTON_PIN_2);</div><div class="line"> debouncer2.interval(5); // interval in ms</div><div class="line"></div><div class="line"></div><div class="line"> //Setup the LED :</div><div class="line"> pinMode(LED_PIN,OUTPUT);</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line">void loop() {</div><div class="line"> // Update the Bounce instances :</div><div class="line"> debouncer1.update();</div><div class="line"> debouncer2.update();</div><div class="line"></div><div class="line"> // Get the updated value :</div><div class="line"> int value1 = debouncer1.read();</div><div class="line"> int value2 = debouncer2.read();</div><div class="line"></div><div class="line"> // Turn on the LED if either button is pressed :</div><div class="line"> if ( value1 == LOW || value2 == LOW ) {</div><div class="line"> digitalWrite(LED_PIN, HIGH );</div><div class="line"> } </div><div class="line"> else {</div><div class="line"> digitalWrite(LED_PIN, LOW );</div><div class="line"> }</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-74
View File
@@ -1,74 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: bounce.ino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">bounce.ino</div> </div>
</div><!--header-->
<div class="contents">
<p>Simple example of the <a class="el" href="class_bounce.html">Bounce</a> library that switches the debug LED when a button is pressed.</p>
<div class="fragment"><div class="line"></div><div class="line">/* </div><div class="line"> DESCRIPTION</div><div class="line"> ====================</div><div class="line"> Simple example of the Bounce library that switches the debug LED when a button is pressed.</div><div class="line"> */</div><div class="line">// Include the Bounce2 library found here :</div><div class="line">// https://github.com/thomasfredericks/Bounce2</div><div class="line">#include &lt;Bounce2.h&gt;</div><div class="line"></div><div class="line">#define BUTTON_PIN 2</div><div class="line">#define LED_PIN 13</div><div class="line"></div><div class="line">// Instantiate a Bounce object</div><div class="line">Bounce debouncer = Bounce(); </div><div class="line"></div><div class="line">void setup() {</div><div class="line"></div><div class="line"> // Setup the button with an internal pull-up :</div><div class="line"> pinMode(BUTTON_PIN,INPUT_PULLUP);</div><div class="line"></div><div class="line"> // After setting up the button, setup the Bounce instance :</div><div class="line"> debouncer.attach(BUTTON_PIN);</div><div class="line"> debouncer.interval(5); // interval in ms</div><div class="line"></div><div class="line"> //Setup the LED :</div><div class="line"> pinMode(LED_PIN,OUTPUT);</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line">void loop() {</div><div class="line"> // Update the Bounce instance :</div><div class="line"> debouncer.update();</div><div class="line"></div><div class="line"> // Get the updated value :</div><div class="line"> int value = debouncer.read();</div><div class="line"></div><div class="line"> // Turn on or off the LED as determined by the state :</div><div class="line"> if ( value == LOW ) {</div><div class="line"> digitalWrite(LED_PIN, HIGH );</div><div class="line"> } </div><div class="line"> else {</div><div class="line"> digitalWrite(LED_PIN, LOW );</div><div class="line"> }</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
@@ -1,74 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: bounce_multiple.ino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">bounce_multiple.ino</div> </div>
</div><!--header-->
<div class="contents">
<p>Detect the falling edge of multiple buttons. Eight buttons with internal pullups. Toggles a LED when any button is pressed. Buttons on pins 2,3,4,5,6,7,8,9</p>
<div class="fragment"><div class="line">// Detect the falling edge of multiple buttons.</div><div class="line">// Eight buttons with internal pullups.</div><div class="line">// Toggles a LED when any button is pressed.</div><div class="line">// Buttons on pins 2,3,4,5,6,7,8,9</div><div class="line"></div><div class="line">// Include the Bounce2 library found here :</div><div class="line">// https://github.com/thomasfredericks/Bounce2</div><div class="line">#include &lt;Bounce2.h&gt;</div><div class="line"></div><div class="line">#define LED_PIN 13</div><div class="line"></div><div class="line">#define NUM_BUTTONS 8</div><div class="line">const uint8_t BUTTON_PINS[NUM_BUTTONS] = {2, 3, 4, 5, 6, 7, 8, 9};</div><div class="line"></div><div class="line">int ledState = LOW;</div><div class="line"></div><div class="line">Bounce * buttons = new Bounce[NUM_BUTTONS];</div><div class="line"></div><div class="line">void setup() {</div><div class="line"></div><div class="line"> for (int i = 0; i &lt; NUM_BUTTONS; i++) {</div><div class="line"> buttons[i].attach( BUTTON_PINS[i] , INPUT_PULLUP ); //setup the bounce instance for the current button</div><div class="line"> buttons[i].interval(25); // interval in ms</div><div class="line"> }</div><div class="line"></div><div class="line"> // Setup the LED :</div><div class="line"> pinMode(LED_PIN, OUTPUT);</div><div class="line"> digitalWrite(LED_PIN, ledState);</div><div class="line"></div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line">void loop() {</div><div class="line"></div><div class="line"> bool needToToggleLed = false;</div><div class="line"></div><div class="line"></div><div class="line"> for (int i = 0; i &lt; NUM_BUTTONS; i++) {</div><div class="line"> // Update the Bounce instance :</div><div class="line"> buttons[i].update();</div><div class="line"> // If it fell, flag the need to toggle the LED</div><div class="line"> if ( buttons[i].fell() ) {</div><div class="line"> needToToggleLed = true;</div><div class="line"> }</div><div class="line"> }</div><div class="line"></div><div class="line"> // if a LED toggle has been flagged :</div><div class="line"> if ( needToToggleLed ) {</div><div class="line"> // Toggle LED state :</div><div class="line"> ledState = !ledState;</div><div class="line"> digitalWrite(LED_PIN, ledState);</div><div class="line"> }</div><div class="line"></div><div class="line"></div><div class="line">}</div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-74
View File
@@ -1,74 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: change.ino</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">change.ino</div> </div>
</div><!--header-->
<div class="contents">
<p>This example toggles the debug LED (pin 13) on or off when a button on pin 2 is pressed.</p>
<div class="fragment"><div class="line"></div><div class="line">// This example toggles the debug LED (pin 13) on or off</div><div class="line">// when a button on pin 2 is pressed.</div><div class="line"></div><div class="line">// Include the Bounce2 library found here :</div><div class="line">// https://github.com/thomasfredericks/Bounce2</div><div class="line">#include &lt;Bounce2.h&gt;</div><div class="line"></div><div class="line">#define BUTTON_PIN 2</div><div class="line">#define LED_PIN 13</div><div class="line"></div><div class="line">int ledState = LOW;</div><div class="line"></div><div class="line"></div><div class="line">Bounce debouncer = Bounce(); // Instantiate a Bounce object</div><div class="line"></div><div class="line">void setup() {</div><div class="line"> </div><div class="line"> debouncer.attach(BUTTON_PIN,INPUT_PULLUP); // Attach the debouncer to a pin with INPUT_PULLUP mode</div><div class="line"> debouncer.interval(25); // Use a debounce interval of 25 milliseconds</div><div class="line"> </div><div class="line"> </div><div class="line"> pinMode(LED_PIN,OUTPUT); // Setup the LED</div><div class="line"> digitalWrite(LED_PIN,ledState);</div><div class="line"> </div><div class="line">}</div><div class="line"></div><div class="line">void loop() {</div><div class="line"></div><div class="line"> debouncer.update(); // Update the Bounce instance</div><div class="line"> </div><div class="line"> if ( debouncer.fell() ) { // Call code if button transitions from HIGH to LOW</div><div class="line"> ledState = !ledState; // Toggle LED state</div><div class="line"> digitalWrite(LED_PIN,ledState); // Apply new LED state</div><div class="line"> }</div><div class="line">}</div><div class="line"></div></div><!-- fragment --> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-95
View File
@@ -1,95 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Member List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">Bounce Member List</div> </div>
</div><!--header-->
<div class="contents">
<p>This is the complete list of members for <a class="el" href="class_bounce.html">Bounce</a>, including all inherited members.</p>
<table class="directory">
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(int pin, int mode)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e">attach</a>(int pin)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#ab34517094faf21d4f38b36da2915132b">Bounce</a>(uint8_t pin, unsigned long interval_millis)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#a62412d814d36102ab3d285e801d5d29a">duration</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">fallingEdge</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289">fell</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c">interval</a>(uint16_t interval_millis)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>interval_millis</b> (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>pin</b> (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>previous_millis</b> (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#ae1936fdf44501992707e6cbaee9bbc76">read</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>readCurrentState</b>() (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">risingEdge</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2">rose</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>setPinMode</b>(int pin, int mode) (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">inline</span><span class="mlabel">protected</span><span class="mlabel">virtual</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>state</b> (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>stateChangeLastTime</b> (defined in <a class="el" href="class_bounce.html">Bounce</a>)</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441">update</a>()</td><td class="entry"><a class="el" href="class_bounce.html">Bounce</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-323
View File
@@ -1,323 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Bounce Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="class_bounce-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">Bounce Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p><code>#include &lt;<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a> ()</td></tr>
<tr class="memdesc:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an instance of the <a class="el" href="class_bounce.html">Bounce</a> class. <a href="#aa62a2e2b5ad0ee6913a95f2f2a0e7606">More...</a><br /></td></tr>
<tr class="separator:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba08e592941465d033e3eba3dde66eaf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a> (int pin, int mode)</td></tr>
<tr class="memdesc:aba08e592941465d033e3eba3dde66eaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT). <a href="#aba08e592941465d033e3eba3dde66eaf">More...</a><br /></td></tr>
<tr class="separator:aba08e592941465d033e3eba3dde66eaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a163477dbcbaf1a3dee6cb3b62eedf09e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e">attach</a> (int pin)</td></tr>
<tr class="separator:a163477dbcbaf1a3dee6cb3b62eedf09e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2c6e68bf749497c597a9437b488b3d7c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c">interval</a> (uint16_t interval_millis)</td></tr>
<tr class="memdesc:a2c6e68bf749497c597a9437b488b3d7c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the debounce interval in milliseconds. <a href="#a2c6e68bf749497c597a9437b488b3d7c">More...</a><br /></td></tr>
<tr class="separator:a2c6e68bf749497c597a9437b488b3d7c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab36d7b83bf32e0935a0c2c6a05096441"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441">update</a> ()</td></tr>
<tr class="memdesc:ab36d7b83bf32e0935a0c2c6a05096441"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the pin's state. <a href="#ab36d7b83bf32e0935a0c2c6a05096441">More...</a><br /></td></tr>
<tr class="separator:ab36d7b83bf32e0935a0c2c6a05096441"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae1936fdf44501992707e6cbaee9bbc76"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#ae1936fdf44501992707e6cbaee9bbc76">read</a> ()</td></tr>
<tr class="memdesc:ae1936fdf44501992707e6cbaee9bbc76"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin's state (HIGH or LOW). <a href="#ae1936fdf44501992707e6cbaee9bbc76">More...</a><br /></td></tr>
<tr class="separator:ae1936fdf44501992707e6cbaee9bbc76"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abfbb0910f5b1ec4e25315cff26dd6289"><td class="memItemLeft" align="right" valign="top"><a id="abfbb0910f5b1ec4e25315cff26dd6289"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289">fell</a> ()</td></tr>
<tr class="memdesc:abfbb0910f5b1ec4e25315cff26dd6289"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
<tr class="separator:abfbb0910f5b1ec4e25315cff26dd6289"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e4187934576e568cdfa8f94efeff6f2"><td class="memItemLeft" align="right" valign="top"><a id="a9e4187934576e568cdfa8f94efeff6f2"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2">rose</a> ()</td></tr>
<tr class="memdesc:a9e4187934576e568cdfa8f94efeff6f2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
<tr class="separator:a9e4187934576e568cdfa8f94efeff6f2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3417beb80eb6593d768c2e9884c57aa0"><td class="memItemLeft" align="right" valign="top"><a id="a3417beb80eb6593d768c2e9884c57aa0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">risingEdge</a> ()</td></tr>
<tr class="memdesc:a3417beb80eb6593d768c2e9884c57aa0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a3417beb80eb6593d768c2e9884c57aa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac756559419bfa1c5060e5e4a4ad6406f"><td class="memItemLeft" align="right" valign="top"><a id="ac756559419bfa1c5060e5e4a4ad6406f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">fallingEdge</a> ()</td></tr>
<tr class="memdesc:ac756559419bfa1c5060e5e4a4ad6406f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:ac756559419bfa1c5060e5e4a4ad6406f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab34517094faf21d4f38b36da2915132b"><td class="memItemLeft" align="right" valign="top"><a id="ab34517094faf21d4f38b36da2915132b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#ab34517094faf21d4f38b36da2915132b">Bounce</a> (uint8_t pin, unsigned long interval_millis)</td></tr>
<tr class="memdesc:ab34517094faf21d4f38b36da2915132b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:ab34517094faf21d4f38b36da2915132b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a62412d814d36102ab3d285e801d5d29a"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a62412d814d36102ab3d285e801d5d29a">duration</a> ()</td></tr>
<tr class="memdesc:a62412d814d36102ab3d285e801d5d29a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the current state. <a href="#a62412d814d36102ab3d285e801d5d29a">More...</a><br /></td></tr>
<tr class="separator:a62412d814d36102ab3d285e801d5d29a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:ad6efc6dd65035de20f015cc44be37873"><td class="memItemLeft" align="right" valign="top"><a id="ad6efc6dd65035de20f015cc44be37873"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>readCurrentState</b> ()</td></tr>
<tr class="separator:ad6efc6dd65035de20f015cc44be37873"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a231a992bf2a1f4521043068e35eb50a6"><td class="memItemLeft" align="right" valign="top"><a id="a231a992bf2a1f4521043068e35eb50a6"></a>
virtual void&#160;</td><td class="memItemRight" valign="bottom"><b>setPinMode</b> (int pin, int mode)</td></tr>
<tr class="separator:a231a992bf2a1f4521043068e35eb50a6"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a223ab27b8094acd12d77a3a9145f56c9"><td class="memItemLeft" align="right" valign="top"><a id="a223ab27b8094acd12d77a3a9145f56c9"></a>
unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>previous_millis</b></td></tr>
<tr class="separator:a223ab27b8094acd12d77a3a9145f56c9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8c1991db9415ccc5acf9b24779b332c7"><td class="memItemLeft" align="right" valign="top"><a id="a8c1991db9415ccc5acf9b24779b332c7"></a>
uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>interval_millis</b></td></tr>
<tr class="separator:a8c1991db9415ccc5acf9b24779b332c7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af013db8b02e1e252eb60dd5b40d5480b"><td class="memItemLeft" align="right" valign="top"><a id="af013db8b02e1e252eb60dd5b40d5480b"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>state</b></td></tr>
<tr class="separator:af013db8b02e1e252eb60dd5b40d5480b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="memItemLeft" align="right" valign="top"><a id="a1cb79cb0ba2379cd12cc7c098d97053a"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>pin</b></td></tr>
<tr class="separator:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5aa630c50e7b783bac50aad0385262e"><td class="memItemLeft" align="right" valign="top"><a id="ad5aa630c50e7b783bac50aad0385262e"></a>
unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>stateChangeLastTime</b></td></tr>
<tr class="separator:ad5aa630c50e7b783bac50aad0385262e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="class_bounce.html">Bounce</a> class. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aa62a2e2b5ad0ee6913a95f2f2a0e7606"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa62a2e2b5ad0ee6913a95f2f2a0e7606">&#9670;&nbsp;</a></span>Bounce()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">Bounce::Bounce </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Create an instance of the <a class="el" href="class_bounce.html">Bounce</a> class. </p>
<div class="fragment"><div class="line"><span class="comment">// Create an instance of the Bounce class.</span></div><div class="line"><a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>() button;</div></div><!-- fragment -->
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="aba08e592941465d033e3eba3dde66eaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aba08e592941465d033e3eba3dde66eaf">&#9670;&nbsp;</a></span>attach() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Bounce::attach </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>pin</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>mode</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT). </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">pin</td><td>The pin that is to be debounced. </td></tr>
<tr><td class="paramname">mode</td><td>A valid Arduino pin mode (INPUT, INPUT_PULLUP or OUTPUT). </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>True if the event read was successful, otherwise false. </dd></dl>
</div>
</div>
<a id="a163477dbcbaf1a3dee6cb3b62eedf09e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a163477dbcbaf1a3dee6cb3b62eedf09e">&#9670;&nbsp;</a></span>attach() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Bounce::attach </td>
<td>(</td>
<td class="paramtype">int&#160;</td>
<td class="paramname"><em>pin</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Attach to a pin for advanced users. Only attach the pin this way once you have previously set it up. Otherwise use <a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf" title="Attach to a pin and sets that pin&#39;s mode (INPUT, INPUT_PULLUP or OUTPUT). ">attach(int pin, int mode)</a>. </p>
</div>
</div>
<a id="a62412d814d36102ab3d285e801d5d29a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a62412d814d36102ab3d285e801d5d29a">&#9670;&nbsp;</a></span>duration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long Bounce::duration </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the duration in milliseconds of the current state. </p>
<p>Is reset to 0 once the pin rises ( <a class="el" href="class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2" title="Returns true if pin signal transitions from low to high. ">rose()</a> ) or falls ( <a class="el" href="class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289" title="Returns true if pin signal transitions from high to low. ">fell()</a> ).</p>
<dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the current state. </dd></dl>
</div>
</div>
<a id="a2c6e68bf749497c597a9437b488b3d7c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2c6e68bf749497c597a9437b488b3d7c">&#9670;&nbsp;</a></span>interval()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void Bounce::interval </td>
<td>(</td>
<td class="paramtype">uint16_t&#160;</td>
<td class="paramname"><em>interval_millis</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Sets the debounce interval in milliseconds. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">interval_millis</td><td>The interval time in milliseconds. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ae1936fdf44501992707e6cbaee9bbc76"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae1936fdf44501992707e6cbaee9bbc76">&#9670;&nbsp;</a></span>read()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Bounce::read </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the pin's state (HIGH or LOW). </p>
<dl class="section return"><dt>Returns</dt><dd>HIGH or LOW. </dd></dl>
</div>
</div>
<a id="ab36d7b83bf32e0935a0c2c6a05096441"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab36d7b83bf32e0935a0c2c6a05096441">&#9670;&nbsp;</a></span>update()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool Bounce::update </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Updates the pin's state. </p>
<p>Because <a class="el" href="class_bounce.html">Bounce</a> 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 <a class="el" href="class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441" title="Updates the pin&#39;s state. ">update()</a> once per loop().</p>
<dl class="section return"><dt>Returns</dt><dd>True if the pin changed state. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>src/<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a></li>
<li>src/Bounce2.cpp</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-82
View File
@@ -1,82 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Class Index</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Class Index</div> </div>
</div><!--header-->
<div class="contents">
<div class="qindex"><a class="qindex" href="#letter_b">b</a></div>
<table class="classindex">
<tr><td rowspan="2" valign="bottom"><a name="letter_b"></a><table border="0" cellspacing="0" cellpadding="0"><tr><td><div class="ah">&#160;&#160;b&#160;&#160;</div></td></tr></table>
</td><td></td></tr>
<tr><td></td></tr>
<tr><td valign="top"><a class="el" href="class_bounce.html">Bounce</a>&#160;&#160;&#160;</td><td></td></tr>
<tr><td></td><td></td></tr>
</table>
<div class="qindex"><a class="qindex" href="#letter_b">b</a></div>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 132 B

@@ -1,77 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: src Directory Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle">
<div class="title">src Directory Reference</div> </div>
</div><!--header-->
<div class="contents">
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 746 B

File diff suppressed because it is too large Load Diff
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

-97
View File
@@ -1,97 +0,0 @@
function toggleVisibility(linkObj)
{
var base = $(linkObj).attr('id');
var summary = $('#'+base+'-summary');
var content = $('#'+base+'-content');
var trigger = $('#'+base+'-trigger');
var src=$(trigger).attr('src');
if (content.is(':visible')===true) {
content.hide();
summary.show();
$(linkObj).addClass('closed').removeClass('opened');
$(trigger).attr('src',src.substring(0,src.length-8)+'closed.png');
} else {
content.show();
summary.hide();
$(linkObj).removeClass('closed').addClass('opened');
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
}
return false;
}
function updateStripes()
{
$('table.directory tr').
removeClass('even').filter(':visible:even').addClass('even');
}
function toggleLevel(level)
{
$('table.directory tr').each(function() {
var l = this.id.split('_').length-1;
var i = $('#img'+this.id.substring(3));
var a = $('#arr'+this.id.substring(3));
if (l<level+1) {
i.removeClass('iconfopen iconfclosed').addClass('iconfopen');
a.html('&#9660;');
$(this).show();
} else if (l==level+1) {
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed');
a.html('&#9658;');
$(this).show();
} else {
$(this).hide();
}
});
updateStripes();
}
function toggleFolder(id)
{
// the clicked row
var currentRow = $('#row_'+id);
// all rows after the clicked row
var rows = currentRow.nextAll("tr");
var re = new RegExp('^row_'+id+'\\d+_$', "i"); //only one sub
// only match elements AFTER this one (can't hide elements before)
var childRows = rows.filter(function() { return this.id.match(re); });
// first row is visible we are HIDING
if (childRows.filter(':first').is(':visible')===true) {
// replace down arrow by right arrow for current row
var currentRowSpans = currentRow.find("span");
currentRowSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
currentRowSpans.filter(".arrow").html('&#9658;');
rows.filter("[id^=row_"+id+"]").hide(); // hide all children
} else { // we are SHOWING
// replace right arrow by down arrow for current row
var currentRowSpans = currentRow.find("span");
currentRowSpans.filter(".iconfclosed").removeClass("iconfclosed").addClass("iconfopen");
currentRowSpans.filter(".arrow").html('&#9660;');
// replace down arrows by right arrows for child rows
var childRowsSpans = childRows.find("span");
childRowsSpans.filter(".iconfopen").removeClass("iconfopen").addClass("iconfclosed");
childRowsSpans.filter(".arrow").html('&#9658;');
childRows.show(); //show all children
}
updateStripes();
}
function toggleInherit(id)
{
var rows = $('tr.inherit.'+id);
var img = $('tr.inherit_header.'+id+' img');
var src = $(img).attr('src');
if (rows.filter(':first').is(':visible')===true) {
rows.css('display','none');
$(img).attr('src',src.substring(0,src.length-8)+'closed.png');
} else {
rows.css('display','table-row'); // using show() causes jump in firefox
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
}
}
-83
View File
@@ -1,83 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Examples</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">Examples</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here is a list of all examples:</div><ul>
<li><a class="el" href="bounce_8ino-example.html">bounce.ino</a></li>
<li><a class="el" href="bounce2buttons_8ino-example.html">bounce2buttons.ino</a></li>
<li><a class="el" href="bounce_multiple_8ino-example.html">bounce_multiple.ino</a></li>
<li><a class="el" href="change_8ino-example.html">change.ino</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-79
View File
@@ -1,79 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: File List</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">File List</div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock">Here is a list of all documented files with brief descriptions:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')">&#160;</span><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html" target="_self">src</a></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a href="_bounce2_8h_source.html"><span class="icondoc"></span></a><b>Bounce2.h</b></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
Binary file not shown.

Before

Width:  |  Height:  |  Size: 616 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 597 B

-101
View File
@@ -1,101 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Class Members</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
<div class="textblock">Here is a list of all documented class members with links to the class documentation for each member:</div><ul>
<li>attach()
: <a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">Bounce</a>
</li>
<li>Bounce()
: <a class="el" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>
</li>
<li>duration()
: <a class="el" href="class_bounce.html#a62412d814d36102ab3d285e801d5d29a">Bounce</a>
</li>
<li>fallingEdge()
: <a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">Bounce</a>
</li>
<li>fell()
: <a class="el" href="class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289">Bounce</a>
</li>
<li>interval()
: <a class="el" href="class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c">Bounce</a>
</li>
<li>read()
: <a class="el" href="class_bounce.html#ae1936fdf44501992707e6cbaee9bbc76">Bounce</a>
</li>
<li>risingEdge()
: <a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">Bounce</a>
</li>
<li>rose()
: <a class="el" href="class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2">Bounce</a>
</li>
<li>update()
: <a class="el" href="class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441">Bounce</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-101
View File
@@ -1,101 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: Class Members - Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="contents">
&#160;<ul>
<li>attach()
: <a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">Bounce</a>
</li>
<li>Bounce()
: <a class="el" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>
</li>
<li>duration()
: <a class="el" href="class_bounce.html#a62412d814d36102ab3d285e801d5d29a">Bounce</a>
</li>
<li>fallingEdge()
: <a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">Bounce</a>
</li>
<li>fell()
: <a class="el" href="class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289">Bounce</a>
</li>
<li>interval()
: <a class="el" href="class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c">Bounce</a>
</li>
<li>read()
: <a class="el" href="class_bounce.html#ae1936fdf44501992707e6cbaee9bbc76">Bounce</a>
</li>
<li>risingEdge()
: <a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">Bounce</a>
</li>
<li>rose()
: <a class="el" href="class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2">Bounce</a>
</li>
<li>update()
: <a class="el" href="class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441">Bounce</a>
</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-103
View File
@@ -1,103 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Bounce2: BOUNCE 2</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">Bounce2
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="headertitle">
<div class="title">BOUNCE 2 </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>Debouncing library for Arduino and Wiring by Thomas Ouellet Fredericks with contributions from: Eric Lowry, Jim Schimpf, Tom Harkaway, Joachim Krüger and MrGradgrind.</p>
<p>More about debouncing: <a href="http://en.wikipedia.org/wiki/Debounce#Contact_bounce">http://en.wikipedia.org/wiki/Debounce#Contact_bounce</a></p>
<p>See the bottom of this page for a basic usage example and the "examples" folder for more.</p>
<h2>GITHUB PAGE</h2>
<p><a href="https://github.com/thomasfredericks/Bounce2">https://github.com/thomasfredericks/Bounce2</a></p>
<h2>DOCUMENTATION</h2>
<p>The complete class documentation can be found in the "docs" folder or <a href="http://thomasfredericks.github.io/Bounce2/">online here</a>.</p>
<h1>HAVE A QUESTION?</h1>
<p>Please post your questions <a href="http://forum.arduino.cc/index.php?topic=266132.0">here</a>.</p>
<h1>INSTALLATION &amp; DOWNLOAD</h1>
<p>Install through your software's Library Manager or download the latest version <a href="https://github.com/thomasfredericks/Bounce2/archive/master.zip">here</a> and put the "Bounce2" folder in your "libraries" folder.</p>
<p>The original version of <a class="el" href="class_bounce.html">Bounce</a> (<a class="el" href="class_bounce.html">Bounce</a> 1) is included in the download but not supported anymore.</p>
<h1>DEBOUNCE ALGORITHMS (FOR ADVANCED USERS)</h1>
<h2>STABLE INTERVAL</h2>
<p>By default, the <a class="el" href="class_bounce.html">Bounce</a> library uses a stable interval to process the debouncing. This is simpler to understand and can cancel unwanted noise.</p>
<div class="image">
<img src="https://raw.github.com/thomasfredericks/Bounce-Arduino-Wiring/master/extras/BouncySwitch_stable.png"/>
</div>
<h2>LOCK-OUT INTERVAL</h2>
<p>By defining "#define BOUNCE_LOCK_OUT" in "Bounce.h" (or in your code before including "Bounce.h") you can activate an alternative debouncing method. This method is a lot more responsive, but does not cancel noise.</p>
<div class="fragment"><div class="line">#define BOUNCE_LOCK_OUT</div></div><!-- fragment --><div class="image">
<img src="https://raw.github.com/thomasfredericks/Bounce-Arduino-Wiring/master/extras/BouncySwitch_lockout.png"/>
</div>
<h2>WITH PROMPT DETECTION</h2>
<p>By defining "#define BOUNCE_WITH_PROMPT_DETECTION" in "Bounce.h" (or in your code before including "Bounce.h") you can activate an alternative debouncing method. Button state changes are available immediately so long as the previous state has been stable for the timeout period. Otherwise the state will be updated as soon as the timeout period allows.</p>
<ul>
<li>Able to report acurate switch time normally with no delay.</li>
<li>Use when accurate switch transition timing is important.</li>
</ul>
<div class="fragment"><div class="line">#define BOUNCE_WITH_PROMPT_DETECTION</div></div><!-- fragment --><h1>BASIC EXAMPLE</h1>
<div class="fragment"><div class="line"><span class="comment">// This example toggles the debug LED (pin 13) on or off</span></div><div class="line"><span class="comment">// when a button on pin 2 is pressed.</span></div><div class="line"></div><div class="line"><span class="comment">// Include the Bounce2 library found here :</span></div><div class="line"><span class="comment">// https://github.com/thomasfredericks/Bounce2</span></div><div class="line"><span class="preprocessor">#include &lt;Bounce2.h&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#define BUTTON_PIN 2</span></div><div class="line"><span class="preprocessor">#define LED_PIN 13</span></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> ledState = LOW;</div><div class="line"></div><div class="line"></div><div class="line"><a class="code" href="class_bounce.html">Bounce</a> debouncer = <a class="code" href="class_bounce.html">Bounce</a>(); <span class="comment">// Instantiate a Bounce object</span></div><div class="line"></div><div class="line"><span class="keywordtype">void</span> setup() {</div><div class="line"></div><div class="line"> debouncer.<a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(BUTTON_PIN,INPUT_PULLUP); <span class="comment">// Attach the debouncer to a pin with INPUT_PULLUP mode</span></div><div class="line"> debouncer.<a class="code" href="class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c">interval</a>(25); <span class="comment">// Use a debounce interval of 25 milliseconds</span></div><div class="line"></div><div class="line"></div><div class="line"> pinMode(LED_PIN,OUTPUT); <span class="comment">// Setup the LED</span></div><div class="line"> digitalWrite(LED_PIN,ledState);</div><div class="line"></div><div class="line">}</div><div class="line"></div><div class="line"><span class="keywordtype">void</span> loop() {</div><div class="line"></div><div class="line"> debouncer.<a class="code" href="class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441">update</a>(); <span class="comment">// Update the Bounce instance</span></div><div class="line"></div><div class="line"> <span class="keywordflow">if</span> ( debouncer.<a class="code" href="class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289">fell</a>() ) { <span class="comment">// Call code if button transitions from HIGH to LOW</span></div><div class="line"> ledState = !ledState; <span class="comment">// Toggle LED state</span></div><div class="line"> digitalWrite(LED_PIN,ledState); <span class="comment">// Apply new LED state</span></div><div class="line"> }</div><div class="line">}</div></div><!-- fragment --> </div></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.13
</small></address>
</body>
</html>
-87
View File
File diff suppressed because one or more lines are too long
-26
View File
@@ -1,26 +0,0 @@
function initMenu(relPath,searchEnabled,serverSide,searchPage,search) {
function makeTree(data,relPath) {
var result='';
if ('children' in data) {
result+='<ul>';
for (var i in data.children) {
result+='<li><a href="'+relPath+data.children[i].url+'">'+
data.children[i].text+'</a>'+
makeTree(data.children[i],relPath)+'</li>';
}
result+='</ul>';
}
return result;
}
$('#main-nav').append(makeTree(menudata,relPath));
$('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu');
if (searchEnabled) {
if (serverSide) {
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><div class="left"><form id="FSearchBox" action="'+searchPage+'" method="get"><img id="MSearchSelect" src="'+relPath+'search/mag.png" alt=""/><input type="text" id="MSearchField" name="query" value="'+search+'" size="20" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)"></form></div><div class="right"></div></div></li>');
} else {
$('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>');
}
}
$('#main-menu').smartmenus();
}
-11
View File
@@ -1,11 +0,0 @@
var menudata={children:[
{text:"Main Page",url:"index.html"},
{text:"Classes",url:"annotated.html",children:[
{text:"Class List",url:"annotated.html"},
{text:"Class Index",url:"classes.html"},
{text:"Class Members",url:"functions.html",children:[
{text:"All",url:"functions.html"},
{text:"Functions",url:"functions_func.html"}]}]},
{text:"Files",url:"files.html",children:[
{text:"File List",url:"files.html"}]},
{text:"Examples",url:"examples.html"}]}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 98 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 B

-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_0.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['attach',['attach',['../class_bounce.html#aba08e592941465d033e3eba3dde66eaf',1,'Bounce::attach(int pin, int mode)'],['../class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e',1,'Bounce::attach(int pin)']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_1.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-5
View File
@@ -1,5 +0,0 @@
var searchData=
[
['bounce',['Bounce',['../class_bounce.html',1,'Bounce'],['../class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606',1,'Bounce::Bounce()'],['../class_bounce.html#ab34517094faf21d4f38b36da2915132b',1,'Bounce::Bounce(uint8_t pin, unsigned long interval_millis)']]],
['bounce_202',['BOUNCE 2',['../index.html',1,'']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_2.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['duration',['duration',['../class_bounce.html#a62412d814d36102ab3d285e801d5d29a',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_3.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-5
View File
@@ -1,5 +0,0 @@
var searchData=
[
['fallingedge',['fallingEdge',['../class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f',1,'Bounce']]],
['fell',['fell',['../class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_4.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['interval',['interval',['../class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_5.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-6
View File
@@ -1,6 +0,0 @@
var searchData=
[
['read',['read',['../class_bounce.html#ae1936fdf44501992707e6cbaee9bbc76',1,'Bounce']]],
['risingedge',['risingEdge',['../class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0',1,'Bounce']]],
['rose',['rose',['../class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="all_6.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['update',['update',['../class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="classes_0.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['bounce',['Bounce',['../class_bounce.html',1,'']]]
];
Binary file not shown.

Before

Width:  |  Height:  |  Size: 273 B

-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_0.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['attach',['attach',['../class_bounce.html#aba08e592941465d033e3eba3dde66eaf',1,'Bounce::attach(int pin, int mode)'],['../class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e',1,'Bounce::attach(int pin)']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_1.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['bounce',['Bounce',['../class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606',1,'Bounce::Bounce()'],['../class_bounce.html#ab34517094faf21d4f38b36da2915132b',1,'Bounce::Bounce(uint8_t pin, unsigned long interval_millis)']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_2.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['duration',['duration',['../class_bounce.html#a62412d814d36102ab3d285e801d5d29a',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_3.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-5
View File
@@ -1,5 +0,0 @@
var searchData=
[
['fallingedge',['fallingEdge',['../class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f',1,'Bounce']]],
['fell',['fell',['../class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_4.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['interval',['interval',['../class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_5.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-6
View File
@@ -1,6 +0,0 @@
var searchData=
[
['read',['read',['../class_bounce.html#ae1936fdf44501992707e6cbaee9bbc76',1,'Bounce']]],
['risingedge',['risingEdge',['../class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0',1,'Bounce']]],
['rose',['rose',['../class_bounce.html#a9e4187934576e568cdfa8f94efeff6f2',1,'Bounce']]]
];
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="functions_6.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['update',['update',['../class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441',1,'Bounce']]]
];
Binary file not shown.

Before

Width:  |  Height:  |  Size: 563 B

-12
View File
@@ -1,12 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</body>
</html>
-26
View File
@@ -1,26 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html><head><title></title>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<link rel="stylesheet" type="text/css" href="search.css"/>
<script type="text/javascript" src="pages_0.js"></script>
<script type="text/javascript" src="search.js"></script>
</head>
<body class="SRPage">
<div id="SRIndex">
<div class="SRStatus" id="Loading">Loading...</div>
<div id="SRResults"></div>
<script type="text/javascript"><!--
createResults();
--></script>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
<script type="text/javascript"><!--
document.getElementById("Loading").style.display="none";
document.getElementById("NoMatches").style.display="none";
var searchResults = new SearchResults("searchResults");
searchResults.Search();
--></script>
</div>
</body>
</html>
-4
View File
@@ -1,4 +0,0 @@
var searchData=
[
['bounce_202',['BOUNCE 2',['../index.html',1,'']]]
];
-271
View File
@@ -1,271 +0,0 @@
/*---------------- Search Box */
#FSearchBox {
float: left;
}
#MSearchBox {
white-space : nowrap;
float: none;
margin-top: 8px;
right: 0px;
width: 170px;
height: 24px;
z-index: 102;
}
#MSearchBox .left
{
display:block;
position:absolute;
left:10px;
width:20px;
height:19px;
background:url('search_l.png') no-repeat;
background-position:right;
}
#MSearchSelect {
display:block;
position:absolute;
width:20px;
height:19px;
}
.left #MSearchSelect {
left:4px;
}
.right #MSearchSelect {
right:5px;
}
#MSearchField {
display:block;
position:absolute;
height:19px;
background:url('search_m.png') repeat-x;
border:none;
width:115px;
margin-left:20px;
padding-left:4px;
color: #909090;
outline: none;
font: 9pt Arial, Verdana, sans-serif;
-webkit-border-radius: 0px;
}
#FSearchBox #MSearchField {
margin-left:15px;
}
#MSearchBox .right {
display:block;
position:absolute;
right:10px;
top:8px;
width:20px;
height:19px;
background:url('search_r.png') no-repeat;
background-position:left;
}
#MSearchClose {
display: none;
position: absolute;
top: 4px;
background : none;
border: none;
margin: 0px 4px 0px 0px;
padding: 0px 0px;
outline: none;
}
.left #MSearchClose {
left: 6px;
}
.right #MSearchClose {
right: 2px;
}
.MSearchBoxActive #MSearchField {
color: #000000;
}
/*---------------- Search filter selection */
#MSearchSelectWindow {
display: none;
position: absolute;
left: 0; top: 0;
border: 1px solid #90A5CE;
background-color: #F9FAFC;
z-index: 10001;
padding-top: 4px;
padding-bottom: 4px;
-moz-border-radius: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-webkit-border-bottom-right-radius: 4px;
-webkit-box-shadow: 5px 5px 5px rgba(0, 0, 0, 0.15);
}
.SelectItem {
font: 8pt Arial, Verdana, sans-serif;
padding-left: 2px;
padding-right: 12px;
border: 0px;
}
span.SelectionMark {
margin-right: 4px;
font-family: monospace;
outline-style: none;
text-decoration: none;
}
a.SelectItem {
display: block;
outline-style: none;
color: #000000;
text-decoration: none;
padding-left: 6px;
padding-right: 12px;
}
a.SelectItem:focus,
a.SelectItem:active {
color: #000000;
outline-style: none;
text-decoration: none;
}
a.SelectItem:hover {
color: #FFFFFF;
background-color: #3D578C;
outline-style: none;
text-decoration: none;
cursor: pointer;
display: block;
}
/*---------------- Search results window */
iframe#MSearchResults {
width: 60ex;
height: 15em;
}
#MSearchResultsWindow {
display: none;
position: absolute;
left: 0; top: 0;
border: 1px solid #000;
background-color: #EEF1F7;
z-index:10000;
}
/* ----------------------------------- */
#SRIndex {
clear:both;
padding-bottom: 15px;
}
.SREntry {
font-size: 10pt;
padding-left: 1ex;
}
.SRPage .SREntry {
font-size: 8pt;
padding: 1px 5px;
}
body.SRPage {
margin: 5px 2px;
}
.SRChildren {
padding-left: 3ex; padding-bottom: .5em
}
.SRPage .SRChildren {
display: none;
}
.SRSymbol {
font-weight: bold;
color: #425E97;
font-family: Arial, Verdana, sans-serif;
text-decoration: none;
outline: none;
}
a.SRScope {
display: block;
color: #425E97;
font-family: Arial, Verdana, sans-serif;
text-decoration: none;
outline: none;
}
a.SRSymbol:focus, a.SRSymbol:active,
a.SRScope:focus, a.SRScope:active {
text-decoration: underline;
}
span.SRScope {
padding-left: 4px;
}
.SRPage .SRStatus {
padding: 2px 5px;
font-size: 8pt;
font-style: italic;
}
.SRResult {
display: none;
}
DIV.searchresults {
margin-left: 10px;
margin-right: 10px;
}
/*---------------- External search page results */
.searchresult {
background-color: #F0F3F8;
}
.pages b {
color: white;
padding: 5px 5px 3px 5px;
background-image: url("../tab_a.png");
background-repeat: repeat-x;
text-shadow: 0 1px 1px #000000;
}
.pages {
line-height: 17px;
margin-left: 4px;
text-decoration: none;
}
.hl {
font-weight: bold;
}
#searchresults {
margin-bottom: 20px;
}
.searchpages {
margin-top: 10px;
}
-791
View File
@@ -1,791 +0,0 @@
function convertToId(search)
{
var result = '';
for (i=0;i<search.length;i++)
{
var c = search.charAt(i);
var cn = c.charCodeAt(0);
if (c.match(/[a-z0-9\u0080-\uFFFF]/))
{
result+=c;
}
else if (cn<16)
{
result+="_0"+cn.toString(16);
}
else
{
result+="_"+cn.toString(16);
}
}
return result;
}
function getXPos(item)
{
var x = 0;
if (item.offsetWidth)
{
while (item && item!=document.body)
{
x += item.offsetLeft;
item = item.offsetParent;
}
}
return x;
}
function getYPos(item)
{
var y = 0;
if (item.offsetWidth)
{
while (item && item!=document.body)
{
y += item.offsetTop;
item = item.offsetParent;
}
}
return y;
}
/* A class handling everything associated with the search panel.
Parameters:
name - The name of the global variable that will be
storing this instance. Is needed to be able to set timeouts.
resultPath - path to use for external files
*/
function SearchBox(name, resultsPath, inFrame, label)
{
if (!name || !resultsPath) { alert("Missing parameters to SearchBox."); }
// ---------- Instance variables
this.name = name;
this.resultsPath = resultsPath;
this.keyTimeout = 0;
this.keyTimeoutLength = 500;
this.closeSelectionTimeout = 300;
this.lastSearchValue = "";
this.lastResultsPage = "";
this.hideTimeout = 0;
this.searchIndex = 0;
this.searchActive = false;
this.insideFrame = inFrame;
this.searchLabel = label;
// ----------- DOM Elements
this.DOMSearchField = function()
{ return document.getElementById("MSearchField"); }
this.DOMSearchSelect = function()
{ return document.getElementById("MSearchSelect"); }
this.DOMSearchSelectWindow = function()
{ return document.getElementById("MSearchSelectWindow"); }
this.DOMPopupSearchResults = function()
{ return document.getElementById("MSearchResults"); }
this.DOMPopupSearchResultsWindow = function()
{ return document.getElementById("MSearchResultsWindow"); }
this.DOMSearchClose = function()
{ return document.getElementById("MSearchClose"); }
this.DOMSearchBox = function()
{ return document.getElementById("MSearchBox"); }
// ------------ Event Handlers
// Called when focus is added or removed from the search field.
this.OnSearchFieldFocus = function(isActive)
{
this.Activate(isActive);
}
this.OnSearchSelectShow = function()
{
var searchSelectWindow = this.DOMSearchSelectWindow();
var searchField = this.DOMSearchSelect();
if (this.insideFrame)
{
var left = getXPos(searchField);
var top = getYPos(searchField);
left += searchField.offsetWidth + 6;
top += searchField.offsetHeight;
// show search selection popup
searchSelectWindow.style.display='block';
left -= searchSelectWindow.offsetWidth;
searchSelectWindow.style.left = left + 'px';
searchSelectWindow.style.top = top + 'px';
}
else
{
var left = getXPos(searchField);
var top = getYPos(searchField);
top += searchField.offsetHeight;
// show search selection popup
searchSelectWindow.style.display='block';
searchSelectWindow.style.left = left + 'px';
searchSelectWindow.style.top = top + 'px';
}
// stop selection hide timer
if (this.hideTimeout)
{
clearTimeout(this.hideTimeout);
this.hideTimeout=0;
}
return false; // to avoid "image drag" default event
}
this.OnSearchSelectHide = function()
{
this.hideTimeout = setTimeout(this.name +".CloseSelectionWindow()",
this.closeSelectionTimeout);
}
// Called when the content of the search field is changed.
this.OnSearchFieldChange = function(evt)
{
if (this.keyTimeout) // kill running timer
{
clearTimeout(this.keyTimeout);
this.keyTimeout = 0;
}
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==40 || e.keyCode==13)
{
if (e.shiftKey==1)
{
this.OnSearchSelectShow();
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
child.focus();
return;
}
}
return;
}
else if (window.frames.MSearchResults.searchResults)
{
var elem = window.frames.MSearchResults.searchResults.NavNext(0);
if (elem) elem.focus();
}
}
else if (e.keyCode==27) // Escape out of the search field
{
this.DOMSearchField().blur();
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.lastSearchValue = '';
this.Activate(false);
return;
}
// strip whitespaces
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
if (searchValue != this.lastSearchValue) // search value has changed
{
if (searchValue != "") // non-empty search
{
// set timer for search update
this.keyTimeout = setTimeout(this.name + '.Search()',
this.keyTimeoutLength);
}
else // empty search field
{
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.lastSearchValue = '';
}
}
}
this.SelectItemCount = function(id)
{
var count=0;
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
count++;
}
}
return count;
}
this.SelectItemSet = function(id)
{
var i,j=0;
var win=this.DOMSearchSelectWindow();
for (i=0;i<win.childNodes.length;i++)
{
var child = win.childNodes[i]; // get span within a
if (child.className=='SelectItem')
{
var node = child.firstChild;
if (j==id)
{
node.innerHTML='&#8226;';
}
else
{
node.innerHTML='&#160;';
}
j++;
}
}
}
// Called when an search filter selection is made.
// set item with index id as the active item
this.OnSelectItem = function(id)
{
this.searchIndex = id;
this.SelectItemSet(id);
var searchValue = this.DOMSearchField().value.replace(/ +/g, "");
if (searchValue!="" && this.searchActive) // something was found -> do a search
{
this.Search();
}
}
this.OnSearchSelectKey = function(evt)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==40 && this.searchIndex<this.SelectItemCount()) // Down
{
this.searchIndex++;
this.OnSelectItem(this.searchIndex);
}
else if (e.keyCode==38 && this.searchIndex>0) // Up
{
this.searchIndex--;
this.OnSelectItem(this.searchIndex);
}
else if (e.keyCode==13 || e.keyCode==27)
{
this.OnSelectItem(this.searchIndex);
this.CloseSelectionWindow();
this.DOMSearchField().focus();
}
return false;
}
// --------- Actions
// Closes the results window.
this.CloseResultsWindow = function()
{
this.DOMPopupSearchResultsWindow().style.display = 'none';
this.DOMSearchClose().style.display = 'none';
this.Activate(false);
}
this.CloseSelectionWindow = function()
{
this.DOMSearchSelectWindow().style.display = 'none';
}
// Performs a search.
this.Search = function()
{
this.keyTimeout = 0;
// strip leading whitespace
var searchValue = this.DOMSearchField().value.replace(/^ +/, "");
var code = searchValue.toLowerCase().charCodeAt(0);
var idxChar = searchValue.substr(0, 1).toLowerCase();
if ( 0xD800 <= code && code <= 0xDBFF && searchValue > 1) // surrogate pair
{
idxChar = searchValue.substr(0, 2);
}
var resultsPage;
var resultsPageWithSearch;
var hasResultsPage;
var idx = indexSectionsWithContent[this.searchIndex].indexOf(idxChar);
if (idx!=-1)
{
var hexCode=idx.toString(16);
resultsPage = this.resultsPath + '/' + indexSectionNames[this.searchIndex] + '_' + hexCode + '.html';
resultsPageWithSearch = resultsPage+'?'+escape(searchValue);
hasResultsPage = true;
}
else // nothing available for this search term
{
resultsPage = this.resultsPath + '/nomatches.html';
resultsPageWithSearch = resultsPage;
hasResultsPage = false;
}
window.frames.MSearchResults.location = resultsPageWithSearch;
var domPopupSearchResultsWindow = this.DOMPopupSearchResultsWindow();
if (domPopupSearchResultsWindow.style.display!='block')
{
var domSearchBox = this.DOMSearchBox();
this.DOMSearchClose().style.display = 'inline';
if (this.insideFrame)
{
var domPopupSearchResults = this.DOMPopupSearchResults();
domPopupSearchResultsWindow.style.position = 'relative';
domPopupSearchResultsWindow.style.display = 'block';
var width = document.body.clientWidth - 8; // the -8 is for IE :-(
domPopupSearchResultsWindow.style.width = width + 'px';
domPopupSearchResults.style.width = width + 'px';
}
else
{
var domPopupSearchResults = this.DOMPopupSearchResults();
var left = getXPos(domSearchBox) + 150; // domSearchBox.offsetWidth;
var top = getYPos(domSearchBox) + 20; // domSearchBox.offsetHeight + 1;
domPopupSearchResultsWindow.style.display = 'block';
left -= domPopupSearchResults.offsetWidth;
domPopupSearchResultsWindow.style.top = top + 'px';
domPopupSearchResultsWindow.style.left = left + 'px';
}
}
this.lastSearchValue = searchValue;
this.lastResultsPage = resultsPage;
}
// -------- Activation Functions
// Activates or deactivates the search panel, resetting things to
// their default values if necessary.
this.Activate = function(isActive)
{
if (isActive || // open it
this.DOMPopupSearchResultsWindow().style.display == 'block'
)
{
this.DOMSearchBox().className = 'MSearchBoxActive';
var searchField = this.DOMSearchField();
if (searchField.value == this.searchLabel) // clear "Search" term upon entry
{
searchField.value = '';
this.searchActive = true;
}
}
else if (!isActive) // directly remove the panel
{
this.DOMSearchBox().className = 'MSearchBoxInactive';
this.DOMSearchField().value = this.searchLabel;
this.searchActive = false;
this.lastSearchValue = ''
this.lastResultsPage = '';
}
}
}
// -----------------------------------------------------------------------
// The class that handles everything on the search results page.
function SearchResults(name)
{
// The number of matches from the last run of <Search()>.
this.lastMatchCount = 0;
this.lastKey = 0;
this.repeatOn = false;
// Toggles the visibility of the passed element ID.
this.FindChildElement = function(id)
{
var parentElement = document.getElementById(id);
var element = parentElement.firstChild;
while (element && element!=parentElement)
{
if (element.nodeName == 'DIV' && element.className == 'SRChildren')
{
return element;
}
if (element.nodeName == 'DIV' && element.hasChildNodes())
{
element = element.firstChild;
}
else if (element.nextSibling)
{
element = element.nextSibling;
}
else
{
do
{
element = element.parentNode;
}
while (element && element!=parentElement && !element.nextSibling);
if (element && element!=parentElement)
{
element = element.nextSibling;
}
}
}
}
this.Toggle = function(id)
{
var element = this.FindChildElement(id);
if (element)
{
if (element.style.display == 'block')
{
element.style.display = 'none';
}
else
{
element.style.display = 'block';
}
}
}
// Searches for the passed string. If there is no parameter,
// it takes it from the URL query.
//
// Always returns true, since other documents may try to call it
// and that may or may not be possible.
this.Search = function(search)
{
if (!search) // get search word from URL
{
search = window.location.search;
search = search.substring(1); // Remove the leading '?'
search = unescape(search);
}
search = search.replace(/^ +/, ""); // strip leading spaces
search = search.replace(/ +$/, ""); // strip trailing spaces
search = search.toLowerCase();
search = convertToId(search);
var resultRows = document.getElementsByTagName("div");
var matches = 0;
var i = 0;
while (i < resultRows.length)
{
var row = resultRows.item(i);
if (row.className == "SRResult")
{
var rowMatchName = row.id.toLowerCase();
rowMatchName = rowMatchName.replace(/^sr\d*_/, ''); // strip 'sr123_'
if (search.length<=rowMatchName.length &&
rowMatchName.substr(0, search.length)==search)
{
row.style.display = 'block';
matches++;
}
else
{
row.style.display = 'none';
}
}
i++;
}
document.getElementById("Searching").style.display='none';
if (matches == 0) // no results
{
document.getElementById("NoMatches").style.display='block';
}
else // at least one result
{
document.getElementById("NoMatches").style.display='none';
}
this.lastMatchCount = matches;
return true;
}
// return the first item with index index or higher that is visible
this.NavNext = function(index)
{
var focusItem;
while (1)
{
var focusName = 'Item'+index;
focusItem = document.getElementById(focusName);
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
{
break;
}
else if (!focusItem) // last element
{
break;
}
focusItem=null;
index++;
}
return focusItem;
}
this.NavPrev = function(index)
{
var focusItem;
while (1)
{
var focusName = 'Item'+index;
focusItem = document.getElementById(focusName);
if (focusItem && focusItem.parentNode.parentNode.style.display=='block')
{
break;
}
else if (!focusItem) // last element
{
break;
}
focusItem=null;
index--;
}
return focusItem;
}
this.ProcessKeys = function(e)
{
if (e.type == "keydown")
{
this.repeatOn = false;
this.lastKey = e.keyCode;
}
else if (e.type == "keypress")
{
if (!this.repeatOn)
{
if (this.lastKey) this.repeatOn = true;
return false; // ignore first keypress after keydown
}
}
else if (e.type == "keyup")
{
this.lastKey = 0;
this.repeatOn = false;
}
return this.lastKey!=0;
}
this.Nav = function(evt,itemIndex)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==13) return true;
if (!this.ProcessKeys(e)) return false;
if (this.lastKey==38) // Up
{
var newIndex = itemIndex-1;
var focusItem = this.NavPrev(newIndex);
if (focusItem)
{
var child = this.FindChildElement(focusItem.parentNode.parentNode.id);
if (child && child.style.display == 'block') // children visible
{
var n=0;
var tmpElem;
while (1) // search for last child
{
tmpElem = document.getElementById('Item'+newIndex+'_c'+n);
if (tmpElem)
{
focusItem = tmpElem;
}
else // found it!
{
break;
}
n++;
}
}
}
if (focusItem)
{
focusItem.focus();
}
else // return focus to search field
{
parent.document.getElementById("MSearchField").focus();
}
}
else if (this.lastKey==40) // Down
{
var newIndex = itemIndex+1;
var focusItem;
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem && elem.style.display == 'block') // children visible
{
focusItem = document.getElementById('Item'+itemIndex+'_c0');
}
if (!focusItem) focusItem = this.NavNext(newIndex);
if (focusItem) focusItem.focus();
}
else if (this.lastKey==39) // Right
{
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem) elem.style.display = 'block';
}
else if (this.lastKey==37) // Left
{
var item = document.getElementById('Item'+itemIndex);
var elem = this.FindChildElement(item.parentNode.parentNode.id);
if (elem) elem.style.display = 'none';
}
else if (this.lastKey==27) // Escape
{
parent.searchBox.CloseResultsWindow();
parent.document.getElementById("MSearchField").focus();
}
else if (this.lastKey==13) // Enter
{
return true;
}
return false;
}
this.NavChild = function(evt,itemIndex,childIndex)
{
var e = (evt) ? evt : window.event; // for IE
if (e.keyCode==13) return true;
if (!this.ProcessKeys(e)) return false;
if (this.lastKey==38) // Up
{
if (childIndex>0)
{
var newIndex = childIndex-1;
document.getElementById('Item'+itemIndex+'_c'+newIndex).focus();
}
else // already at first child, jump to parent
{
document.getElementById('Item'+itemIndex).focus();
}
}
else if (this.lastKey==40) // Down
{
var newIndex = childIndex+1;
var elem = document.getElementById('Item'+itemIndex+'_c'+newIndex);
if (!elem) // last child, jump to parent next parent
{
elem = this.NavNext(itemIndex+1);
}
if (elem)
{
elem.focus();
}
}
else if (this.lastKey==27) // Escape
{
parent.searchBox.CloseResultsWindow();
parent.document.getElementById("MSearchField").focus();
}
else if (this.lastKey==13) // Enter
{
return true;
}
return false;
}
}
function setKeyActions(elem,action)
{
elem.setAttribute('onkeydown',action);
elem.setAttribute('onkeypress',action);
elem.setAttribute('onkeyup',action);
}
function setClassAttr(elem,attr)
{
elem.setAttribute('class',attr);
elem.setAttribute('className',attr);
}
function createResults()
{
var results = document.getElementById("SRResults");
for (var e=0; e<searchData.length; e++)
{
var id = searchData[e][0];
var srResult = document.createElement('div');
srResult.setAttribute('id','SR_'+id);
setClassAttr(srResult,'SRResult');
var srEntry = document.createElement('div');
setClassAttr(srEntry,'SREntry');
var srLink = document.createElement('a');
srLink.setAttribute('id','Item'+e);
setKeyActions(srLink,'return searchResults.Nav(event,'+e+')');
setClassAttr(srLink,'SRSymbol');
srLink.innerHTML = searchData[e][1][0];
srEntry.appendChild(srLink);
if (searchData[e][1].length==2) // single result
{
srLink.setAttribute('href',searchData[e][1][1][0]);
if (searchData[e][1][1][1])
{
srLink.setAttribute('target','_parent');
}
var srScope = document.createElement('span');
setClassAttr(srScope,'SRScope');
srScope.innerHTML = searchData[e][1][1][2];
srEntry.appendChild(srScope);
}
else // multiple results
{
srLink.setAttribute('href','javascript:searchResults.Toggle("SR_'+id+'")');
var srChildren = document.createElement('div');
setClassAttr(srChildren,'SRChildren');
for (var c=0; c<searchData[e][1].length-1; c++)
{
var srChild = document.createElement('a');
srChild.setAttribute('id','Item'+e+'_c'+c);
setKeyActions(srChild,'return searchResults.NavChild(event,'+e+','+c+')');
setClassAttr(srChild,'SRScope');
srChild.setAttribute('href',searchData[e][1][c+1][0]);
if (searchData[e][1][c+1][1])
{
srChild.setAttribute('target','_parent');
}
srChild.innerHTML = searchData[e][1][c+1][2];
srChildren.appendChild(srChild);
}
srEntry.appendChild(srChildren);
}
srResult.appendChild(srEntry);
results.appendChild(srResult);
}
}
function init_search()
{
var results = document.getElementById("MSearchSelectWindow");
for (var key in indexSectionLabels)
{
var link = document.createElement('a');
link.setAttribute('class','SelectItem');
link.setAttribute('onclick','searchBox.OnSelectItem('+key+')');
link.href='javascript:void(0)';
link.innerHTML='<span class="SelectionMark">&#160;</span>'+indexSectionLabels[key];
results.appendChild(link);
}
searchBox.OnSelectItem(0);
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 604 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 612 B

-24
View File
@@ -1,24 +0,0 @@
var indexSectionsWithContent =
{
0: "abdfiru",
1: "b",
2: "abdfiru",
3: "b"
};
var indexSectionNames =
{
0: "all",
1: "classes",
2: "functions",
3: "pages"
};
var indexSectionLabels =
{
0: "All",
1: "Classes",
2: "Functions",
3: "Pages"
};
Binary file not shown.

Before

Width:  |  Height:  |  Size: 314 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 853 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 845 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 142 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 184 B

File diff suppressed because one or more lines are too long
-1
View File
@@ -1 +0,0 @@
<meta http-equiv="refresh" content="0; URL='files/index.html'" />
-48
View File
@@ -1,48 +0,0 @@
/*
DESCRIPTION
====================
Simple example of the Bounce library that switches the debug LED when a button is pressed.
*/
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#define BUTTON_PIN 2
#define LED_PIN 13
// Instantiate a Bounce object
Bounce debouncer = Bounce();
void setup() {
// Setup the button with an internal pull-up :
pinMode(BUTTON_PIN,INPUT_PULLUP);
// After setting up the button, setup the Bounce instance :
debouncer.attach(BUTTON_PIN);
debouncer.interval(5); // interval in ms
//Setup the LED :
pinMode(LED_PIN,OUTPUT);
}
void loop() {
// Update the Bounce instance :
debouncer.update();
// Get the updated value :
int value = debouncer.read();
// Turn on or off the LED as determined by the state :
if ( value == LOW ) {
digitalWrite(LED_PIN, HIGH );
}
else {
digitalWrite(LED_PIN, LOW );
}
}
+70
View File
@@ -0,0 +1,70 @@
/*
DESCRIPTION
====================
Simple example of the Bounce library that switches a LED when
a state change (from HIGH to LOW) is triggered (for example when a button is pressed).
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE LED STATE
int ledState = LOW;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, ledState);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// <Bounce>.changed() RETURNS true IF THE STATE CHANGED (FROM HIGH TO LOW OR LOW TO HIGH)
if ( bounce.changed() ) {
// THE STATE OF THE INPUT CHANGED
// GET THE STATE
int deboucedInput = bounce.read();
// IF THE CHANGED VALUE IS LOW
if ( deboucedInput == LOW ) {
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState); // WRITE THE NEW ledState
}
}
}
+77
View File
@@ -0,0 +1,77 @@
/*
DESCRIPTION
====================
This is an example of the Bounce2::Button class.
When the user presses a physical button, it toggles a LED on or off.
The Button class matches an electrical state to a physical action.
Use .setPressedState(LOW or HIGH) to set the detection state for when the button is pressed.
INSCRUCTIONS
====================
Set BUTTON_PIN to the pin attached to the button.
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE BUTTON TO THE FOLLOWING PIN IN setup()
#define BUTTON_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
//#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
#define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Button OBJECT FROM THE Bounce2 NAMESPACE
Bounce2::Button button = Bounce2::Button();
// SET A VARIABLE TO STORE THE LED STATE
int ledState = LOW;
void setup() {
// BUTTON SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR BUTTON HAS AN INTERNAL PULL-UP
// button.attach( BUTTON_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR BUTTON USES AN EXTERNAL PULL-UP
button.attach( BUTTON_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
button.interval(5);
// INDICATE THAT THE LOW STATE CORRESPONDS TO PHYSICALLY PRESSING THE BUTTON
button.setPressedState(LOW);
// LED SETUP
pinMode(LED_PIN,OUTPUT);
digitalWrite(LED_PIN,ledState);
}
void loop() {
// UPDATE THE BUTTON
// YOU MUST CALL THIS EVERY LOOP
button.update();
// <Button>.pressed() RETURNS true IF THE STATE CHANGED
// AND THE CURRENT STATE MATCHES <Button>.setPressedState(<HIGH or LOW>);
// WHICH IS LOW IN THIS EXAMPLE AS SET WITH button.setPressedState(LOW); IN setup()
if ( button.pressed() ) {
// TOGGLE THE LED STATE :
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState); // WRITE THE NEW ledState
}
}
-53
View File
@@ -1,53 +0,0 @@
/*
DESCRIPTION
====================
Reports through serial (57600 baud) the time since
a button press (transition from HIGH to LOW).
*/
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
#define BUTTON_PIN 2
#define LED_PIN 13
// Instantiate a Bounce object :
Bounce debouncer = Bounce();
unsigned long buttonPressTimeStamp;
void setup() {
Serial.begin(57600);
// Setup the button with an internal pull-up :
pinMode(BUTTON_PIN,INPUT_PULLUP);
// After setting up the button, setup the Bounce instance :
debouncer.attach(BUTTON_PIN);
debouncer.interval(5);
// Setup the LED :
pinMode(LED_PIN,OUTPUT);
}
void loop() {
// Update the Bounce instance :
debouncer.update();
// Call code if Bounce fell (transition from HIGH to LOW) :
if ( debouncer.fell() ) {;
Serial.println( millis()-buttonPressTimeStamp );
buttonPressTimeStamp = millis();
}
}
@@ -0,0 +1,67 @@
/*
DESCRIPTION
====================
Simple example of the Bounce library that switches on a LED when
the decounced input is held for more than 1000 milliseconds.
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT.
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE LED STATE
int ledState = LOW;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, ledState);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// GET THE STATE WITH <Bounce.read()>
int debouncedState = bounce.read();
// <Bounce>.duration() RETURNS THE TIME IN MILLISECONDS THE CURRENT STATE HAS BEEN HELD.
// SO WE CHECK IF THE STATE IS LOW AND IF IT HAS BEEN LOW FOR MORE THAN 1 SECOND.
if ( debouncedState == LOW && bounce.currentDuration() > 1000 ) {
digitalWrite(LED_PIN,HIGH); // TURN THE LED ON
} else {
digitalWrite(LED_PIN,LOW); // TURN THE LED OFF
}
}
@@ -0,0 +1,67 @@
// Le code de base pour le M5Stack Atom
// Inclure la librairie M5 (version pour M5Atom) :
// https://github.com/m5stack/M5Atom
#include <M5Atom.h>
// Inclure la librairie FastLED qui va gérer le pixel :
// https://github.com/FastLED/FastLED
#include <FastLED.h>
// Un tableau qui contient une variable de type CRGB.
// Il y a un seul pixel, mais il doit être dans un tableau.
// CRGB est un type de couleur défini par la lirairie FastLed :
// https://github.com/FastLED/FastLED/wiki/Pixel-reference#crgb-reference
CRGB mesPixels[1];
#include <Bounce2.h>
Bounce2::Button button = Bounce2::Button(); // INSTANTIATE A Bounce2::Button OBJECT
bool ledToggle = false;
void setup() {
// Démarrer la libraire M5 avec toutes les options de pré-configuration désactivées :
M5.begin(false, false, false);
// Démarrer la connexion sérielle :
Serial.begin(115200);
// Ajouter le pixel (il y en a un seul) du M5Atom à la librairie FastLED :
FastLED.addLeds<WS2812, DATA_PIN, GRB>(mesPixels, 1);
// Animation de démarrage
while (millis() < 5000) {
mesPixels[0] = CHSV((millis() / 5) % 255, 255, 255 - (millis() * 255 / 5000));
FastLED.show();
delay(50);
}
mesPixels[0] = CRGB(0, 0, 0);
FastLED.show();
button.attach(32, INPUT_PULLUP);
button.interval(5);
button.setPressedState(LOW);
}
void loop() {
// Toujours inclure M5.update() au début de loop() :
M5.update();
// UPDATE THE BUTTON BY CALLING .update() AT THE BEGINNING OF THE LOOP:
button.update();
// IF THE BUTTON WAS PRESSED THIS LOOP:
if (button.pressed()) {
// DO SOMETHING IF THE BUTTON WAS PRESSED THIS LOOP...
if (ledToggle) {
ledToggle = false;
mesPixels[0] = CRGB(0, 0, 0);
} else {
ledToggle = true;
mesPixels[0] = CRGB(255, 255, 255);
}
FastLED.show();
}
}
@@ -0,0 +1,73 @@
/*
DESCRIPTION
====================
When the debounced input goes from LOW to HIGH, the LED will turn on for the same time
the debounced input was held LOW.
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT.
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE INTERVAL FOR HOW LONG TO KEEP THE LED HIGH
unsigned long ledHighInterval;
// SET A VARIABLE TO STORE THE START TIME WHEN THE LED WAS TURNED HIGH
unsigned long ledHighLastTime;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// <Bounce>.rose() RETURNS true IF THE STATE JUST WENT FROM LOW TO HIGH
if ( bounce.rose() ) {
digitalWrite(LED_PIN, HIGH); // TURN ON THE LED
ledHighLastTime = millis();
ledHighInterval = bounce.previousDuration();
}
// IF WE HAVE TO BLINK THE LED
if ( millis() - ledHighLastTime > ledHighInterval ) {
digitalWrite(LED_PIN, LOW);
} else {
digitalWrite(LED_PIN, HIGH);
}
}
@@ -0,0 +1,88 @@
/*
DESCRIPTION
====================
Simple example of the Bounce library that switches the state of a LED
when the debounced input goes from LOW to HIGH.
Also if the debounced input was previously held LOW for more than 1000 milliseconds,
the LED will blink.
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT.
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE LED STATE
int ledState = LOW;
// SET A VARIABLE TO STORE THE BLINKING STATE
bool blinkLed = false;
// SET A VARIABLE TO STORE THE LAST TIME THE LED BLINKED
unsigned long blinkLedLastTime;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, ledState);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// <Bounce>.changed() RETURNS true IF THE STATE CHANGED (FROM HIGH TO LOW OR LOW TO HIGH)
if ( bounce.changed() ) {
// THE STATE OF THE INPUT CHANGED
// GET THE STATE
int deboucedInput = bounce.read();
// IF THE CHANGED VALUE IS HIGH
if ( deboucedInput == HIGH ) {
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState); // WRITE THE NEW ledState
// IF THE DURATION OF THE PREVIOUS STATE (LOW IN THIS CASE) WAS HELD LONGER THAN 1000 MILLISECONDS:
if ( bounce.previousDuration() > 1000 ) blinkLed = true;
else blinkLed = false;
}
}
// IF WE HAVE TO BLINK THE LED
if ( blinkLed ) {
if ( millis() - blinkLedLastTime > 500 ) {
blinkLedLastTime = millis();
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState); // WRITE THE NEW ledState
}
}
}
+8 -1
View File
@@ -7,7 +7,9 @@
#######################################
Bounce KEYWORD1
Bounce2 KEYWORD1
Button KEYWORD1
Bounce2NameSpace KEYWORD1
#######################################
# Methods and Functions (KEYWORD2)
#######################################
@@ -19,6 +21,11 @@ attach KEYWORD2
rose KEYWORD2
fell KEYWORD2
duration KEYWORD2
pressed KEYWORD2
released KEYWORD2
setPressedState KEYWORD2
currentDuration KEYWORD2
previousDuration KEYWORD2
#######################################
# Instances (KEYWORD2)
+1 -1
View File
@@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/thomasfredericks/Bounce2.git"
},
"version": "2.52",
"version": "2.72",
"exclude": [
"*.png",
"*.zip"
+3 -2
View File
@@ -1,9 +1,10 @@
name=Bounce2
version=2.52
version=2.72
author=Thomas O Fredericks <tof@t-o-f.info> with contributions from Eric Lowry, Jim Schimpf, Tom Harkaway, Joachim Krüger and MrGradgrind.
maintainer=Thomas O Fredericks <tof@t-o-f.info>
sentence=Debouncing library for Arduino and Wiring.
paragraph=Deboucing switches and toggles is important.
paragraph=Debouncing switches and toggles is important.
category=Signal Input/Output
includes=Bounce2.h
url=https://github.com/thomasfredericks/Bounce2
architectures=*
+49 -34
View File
@@ -3,42 +3,33 @@
#include "Bounce2.h"
static const uint8_t DEBOUNCED_STATE = 0b00000001;
static const uint8_t UNSTABLE_STATE = 0b00000010;
static const uint8_t CHANGED_STATE = 0b00000100;
//////////////
// DEBOUNCE //
//////////////
Bounce::Bounce()
: previous_millis(0)
Debouncer::Debouncer():previous_millis(0)
, interval_millis(10)
, state(0)
, pin(0)
{}
, state(0) {}
void Bounce::attach(int pin) {
this->pin = pin;
state = 0;
void Debouncer::interval(uint16_t interval_millis)
{
this->interval_millis = interval_millis;
}
void Debouncer::begin() {
state = 0;
if (readCurrentState()) {
setStateFlag(DEBOUNCED_STATE | UNSTABLE_STATE);
}
#ifdef BOUNCE_LOCK_OUT
#ifdef BOUNCE_LOCK_OUT
previous_millis = 0;
#else
previous_millis = millis();
#endif
}
void Bounce::attach(int pin, int mode){
setPinMode(pin, mode);
this->attach(pin);
}
void Bounce::interval(uint16_t interval_millis)
{
this->interval_millis = interval_millis;
}
bool Bounce::update()
bool Debouncer::update()
{
unsetStateFlag(CHANGED_STATE);
@@ -104,37 +95,61 @@ bool Bounce::update()
#endif
return getStateFlag(CHANGED_STATE);
return changed();
}
/*
// WIP HELD
unsigned long Bounce::held() {
unsigned long Debouncer::previousDuration() const {
return durationOfPreviousState;
}
*/
unsigned long Bounce::duration() {
unsigned long Debouncer::currentDuration() const {
return (millis() - stateChangeLastTime);
}
inline void Bounce::changeState() {
inline void Debouncer::changeState() {
toggleStateFlag(DEBOUNCED_STATE);
setStateFlag(CHANGED_STATE) ;
// WIP HELD : durationOfPreviousState = millis() - stateChangeLastTime;
durationOfPreviousState = millis() - stateChangeLastTime;
stateChangeLastTime = millis();
}
bool Bounce::read()
bool Debouncer::read() const
{
return getStateFlag(DEBOUNCED_STATE);
}
bool Bounce::rose()
bool Debouncer::rose() const
{
return getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE);
}
bool Bounce::fell()
bool Debouncer::fell() const
{
return !getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE);
}
////////////
// BOUNCE //
////////////
Bounce::Bounce()
: pin(0)
{}
void Bounce::attach(int pin) {
this->pin = pin;
// SET INITIAL STATE
begin();
}
void Bounce::attach(int pin, int mode){
setPinMode(pin, mode);
this->attach(pin);
}
+233 -93
View File
@@ -26,6 +26,7 @@
Previous contributions by Eric Lowry, Jim Schimpf and Tom Harkaway
* * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifndef Bounce2_h
#define Bounce2_h
@@ -44,31 +45,147 @@
#include <inttypes.h>
/**
@example bounce.ino
Simple example of the Bounce library that switches the debug LED when a button is pressed.
@example bounce_basic.ino
Basic example of the Bounce class.
*/
/**
@example change.ino
This example toggles the debug LED (pin 13) on or off when a button on pin 2 is pressed.
@example button_basic.ino
Basic example of the Button class.
*/
/**
@example bounce_multiple.ino
Detect the falling edge of multiple buttons. Eight buttons with internal pullups. Toggles a LED when any button is pressed. Buttons on pins 2,3,4,5,6,7,8,9
@brief The Debouce class. Just the deboucing code separated from all harware.
*/
/**
@example bounce2buttons.ino
Example of two instances of the Bounce class that switches the debug LED when either one of the two buttons is pressed.
*/
/**
The Bounce class.
*/
class Bounce
class Debouncer
{
public:
// Note : this is private as it migh change in the future
private:
static const uint8_t DEBOUNCED_STATE = 0b00000001; // Final returned calculated debounced state
static const uint8_t UNSTABLE_STATE = 0b00000010; // Actual last state value behind the scene
static const uint8_t CHANGED_STATE = 0b00000100; // The DEBOUNCED_STATE has changed since last update()
// Note : this is private as it migh change in the future
private:
inline void changeState();
inline void setStateFlag(const uint8_t flag) {state |= flag;}
inline void unsetStateFlag(const uint8_t flag) {state &= ~flag;}
inline void toggleStateFlag(const uint8_t flag) {state ^= flag;}
inline bool getStateFlag(const uint8_t flag) const {return((state & flag) != 0);}
public:
/*!
@brief Create an instance of the Debounce class.
@endcode
*/
Debouncer();
/**
@brief Sets the debounce interval in milliseconds.
@param interval_millis
The interval time in milliseconds.
*/
void interval(uint16_t interval_millis);
/*!
@brief 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() once per loop().
@return True if the pin changed state.
*/
bool update();
/**
@brief Returns the pin's state (HIGH or LOW).
@return HIGH or LOW.
*/
bool read() const;
/**
@brief Returns true if pin signal transitions from high to low.
*/
bool fell() const;
/**
@brief Returns true if pin signal transitions from low to high.
*/
bool rose() const;
public:
/**
@brief Returns true if the state changed on last update.
@return True if the state changed on last update. Otherwise, returns false.
*/
bool changed( ) const { return getStateFlag(CHANGED_STATE); }
/**
@brief Returns the duration in milliseconds of the current state.
Is reset to 0 once the pin rises ( rose() ) or falls ( fell() ).
@return The duration in milliseconds (unsigned long) of the current state.
*/
unsigned long currentDuration() const;
/**
@brief Returns the duration in milliseconds of the previous state.
Takes the values of duration() once the pin changes state.
@return The duration in milliseconds (unsigned long) of the previous state.
*/
unsigned long previousDuration() const;
/**
@brief DEPRECATED (i.e. do not use). Renamed currentDuration().
This member function is DEPRECATED will be removed next major version. DO NOT USE IT. USE currentDuration() INSTEAD.
It was renamed to avoid confusion with previousDuration().
@return The duration in milliseconds (unsigned long) of the current state.
*/
[[deprecated]]
unsigned long duration() {
return currentDuration();
};
protected:
void begin();
virtual bool readCurrentState() =0;
unsigned long previous_millis;
uint16_t interval_millis;
uint8_t state;
unsigned long stateChangeLastTime;
unsigned long durationOfPreviousState;
};
/**
@brief The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named, but it will be kept that so it stays compatible with previous code.
*/
class Bounce : public Debouncer
{
public:
/*!
@brief Create an instance of the Bounce class.
@@ -80,7 +197,7 @@ class Bounce
@endcode
*/
Bounce();
Bounce();
/*!
@@ -90,105 +207,128 @@ class Bounce
The pin that is to be debounced.
@param mode
A valid Arduino pin mode (INPUT, INPUT_PULLUP or OUTPUT).
@return True if the event read was successful, otherwise false.
*/
void attach(int pin, int mode);
void attach(int pin, int mode);
/**
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).
*/
void attach(int pin);
void attach(int pin);
/**
@brief Sets the debounce interval in milliseconds.
@param interval_millis
The interval time in milliseconds.
*/
void interval(uint16_t interval_millis);
Bounce(uint8_t pin, unsigned long interval_millis ) : Bounce() {
attach(pin);
interval(interval_millis);
}
/**
@brief Return pin that this Bounce is attached to
@return integer identifier of the coupled pin
*/
inline int getPin() const {
return this->pin;
};
/*!
@brief Updates the pin's state.
////////////////
// Deprecated //
////////////////
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().
@return True if the pin changed state.
*/
bool update();
/**
@brief Returns the pin's state (HIGH or LOW).
@return HIGH or LOW.
*/
bool read();
/**
@brief Returns true if pin signal transitions from high to low.
*/
bool fell();
/**
@brief Returns true if pin signal transitions from low to high.
*/
bool rose();
/**
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1
*/
bool risingEdge() { return rose(); }
[[deprecated]]
bool risingEdge() const { return rose(); }
/**
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1
*/
bool fallingEdge() { return fell(); }
[[deprecated]]
bool fallingEdge() const { return fell(); }
/**
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1
*/
Bounce(uint8_t pin, unsigned long interval_millis ) : Bounce() {
attach(pin);
interval(interval_millis);
}
/**
@brief Returns the duration in milliseconds of the current state.
Is reset to 0 once the pin rises ( rose() ) or falls ( fell() ).
@return The duration in milliseconds (unsigned long) of the current state.
*/
unsigned long duration();
// WIP HELD : unsigned long held(); // Returns the duration the previous state was held
protected:
protected:
unsigned long previous_millis;
uint16_t interval_millis;
uint8_t state;
uint8_t pin;
unsigned long stateChangeLastTime;
// WIP HELD : unsigned long durationOfPreviousState;
virtual bool readCurrentState() { return digitalRead(pin); }
virtual void setPinMode(int pin, int mode) {
#if defined(ARDUINO_STM_NUCLEO_F103RB) || defined(ARDUINO_GENERIC_STM32F103C)
pinMode(pin, (WiringPinMode)mode);
uint8_t pin;
virtual bool readCurrentState() { return digitalRead(pin); }
virtual void setPinMode(int pin, int mode) {
#if defined(ARDUINO_ARCH_STM32F1)
pinMode(pin, (WiringPinMode)mode);
#else
pinMode(pin, mode);
pinMode(pin, mode);
#endif
}
}
private:
inline void changeState();
inline void setStateFlag(const uint8_t flag) {state |= flag;}
inline void unsetStateFlag(const uint8_t flag) {state &= ~flag;}
inline void toggleStateFlag(const uint8_t flag) {state ^= flag;}
inline bool getStateFlag(const uint8_t flag) {return((state & flag) != 0);}
};
/**
@brief The Debouncer:Bounce:Button class. The Button class matches an electrical state to a physical action.
*/
namespace Bounce2 {
// code declarations
class Button : public Bounce{
protected:
bool stateForPressed = 1; //
public:
/*!
@brief Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical level.
@code
// Create an instance of the Button class.
Button() button;
@endcode
*/
Button(){ }
/*!
@brief Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default, the pressed state is matched to a HIGH electrical level.
@param state
The electrical state (HIGH/LOW) that corresponds to a physical press.
*/
void setPressedState(bool state){
stateForPressed = state;
}
/*!
@brief Get the electrical state (HIGH/LOW) that corresponds to a physical press.
*/
inline bool getPressedState() const {
return stateForPressed;
};
/*!
@brief Returns true if the button is currently physically pressed.
*/
inline bool isPressed() const {
return read() == getPressedState();
};
/*!
@brief Returns true if the button was physically pressed
*/
inline bool pressed() const {
return changed() && isPressed();
};
/*!
@brief Returns true if the button was physically released
*/
inline bool released() const {
return changed() && !isPressed();
};
};
};
#endif