@ -0,0 +1,20 @@ |
|||||||
|
The MIT License (MIT) |
||||||
|
|
||||||
|
Copyright (c) 2013 thomasfredericks |
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of |
||||||
|
this software and associated documentation files (the "Software"), to deal in |
||||||
|
the Software without restriction, including without limitation the rights to |
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so, |
||||||
|
subject to the following conditions: |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all |
||||||
|
copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
@ -0,0 +1,97 @@ |
|||||||
|
# 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. |
||||||
|
|
||||||
|
More about debouncing: 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/). |
||||||
|
|
||||||
|
# HAVE A QUESTION? |
||||||
|
|
||||||
|
Please post your questions [here](http://forum.arduino.cc/index.php?topic=266132.0). |
||||||
|
|
||||||
|
# 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. |
||||||
|
|
||||||
|
|
||||||
|
# DEBOUNCE ALGORITHMS (FOR ADVANCED USERS) |
||||||
|
|
||||||
|
|
||||||
|
## STABLE INTERVAL |
||||||
|
|
||||||
|
By default, the Bounce library uses a stable interval to process the debouncing. This is simpler to understand and can cancel unwanted noise. |
||||||
|
|
||||||
|
![](https://raw.github.com/thomasfredericks/Bounce-Arduino-Wiring/master/extras/BouncySwitch_stable.png) |
||||||
|
|
||||||
|
## 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. |
||||||
|
|
||||||
|
``` |
||||||
|
#define BOUNCE_LOCK_OUT |
||||||
|
``` |
||||||
|
|
||||||
|
![](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. |
||||||
|
|
||||||
|
* Able to report acurate switch time normally with no delay. |
||||||
|
* Use when accurate switch transition timing is important. |
||||||
|
|
||||||
|
``` |
||||||
|
#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 |
||||||
|
} |
||||||
|
} |
||||||
|
``` |
@ -0,0 +1,78 @@ |
|||||||
|
<!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;"> </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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 676 B |
After Width: | Height: | Size: 147 B |
@ -0,0 +1,74 @@ |
|||||||
|
<!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 <Bounce2.h></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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,74 @@ |
|||||||
|
<!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 <Bounce2.h></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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,74 @@ |
|||||||
|
<!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 <Bounce2.h></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 < 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 < 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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,74 @@ |
|||||||
|
<!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 <Bounce2.h></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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,95 @@ |
|||||||
|
<!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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,323 @@ |
|||||||
|
<!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> | |
||||||
|
<a href="#pro-methods">Protected Member Functions</a> | |
||||||
|
<a href="#pro-attribs">Protected Attributes</a> | |
||||||
|
<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 <<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a>></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"> </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:aba08e592941465d033e3eba3dde66eaf"><td class="memItemLeft" align="right" valign="top">void </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:a163477dbcbaf1a3dee6cb3b62eedf09e"><td class="memItemLeft" align="right" valign="top">void </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"> </td></tr> |
||||||
|
<tr class="memitem:a2c6e68bf749497c597a9437b488b3d7c"><td class="memItemLeft" align="right" valign="top">void </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:ab36d7b83bf32e0935a0c2c6a05096441"><td class="memItemLeft" align="right" valign="top">bool </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:ae1936fdf44501992707e6cbaee9bbc76"><td class="memItemLeft" align="right" valign="top">bool </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:abfbb0910f5b1ec4e25315cff26dd6289"><td class="memItemLeft" align="right" valign="top"><a id="abfbb0910f5b1ec4e25315cff26dd6289"></a> |
||||||
|
bool </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:a9e4187934576e568cdfa8f94efeff6f2"><td class="memItemLeft" align="right" valign="top"><a id="a9e4187934576e568cdfa8f94efeff6f2"></a> |
||||||
|
bool </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:a3417beb80eb6593d768c2e9884c57aa0"><td class="memItemLeft" align="right" valign="top"><a id="a3417beb80eb6593d768c2e9884c57aa0"></a> |
||||||
|
bool </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:ac756559419bfa1c5060e5e4a4ad6406f"><td class="memItemLeft" align="right" valign="top"><a id="ac756559419bfa1c5060e5e4a4ad6406f"></a> |
||||||
|
bool </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:ab34517094faf21d4f38b36da2915132b"><td class="memItemLeft" align="right" valign="top"><a id="ab34517094faf21d4f38b36da2915132b"></a> |
||||||
|
 </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"> </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"> </td></tr> |
||||||
|
<tr class="memitem:a62412d814d36102ab3d285e801d5d29a"><td class="memItemLeft" align="right" valign="top">unsigned long </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"> </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"> </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 </td><td class="memItemRight" valign="bottom"><b>readCurrentState</b> ()</td></tr> |
||||||
|
<tr class="separator:ad6efc6dd65035de20f015cc44be37873"><td class="memSeparator" colspan="2"> </td></tr> |
||||||
|
<tr class="memitem:a231a992bf2a1f4521043068e35eb50a6"><td class="memItemLeft" align="right" valign="top"><a id="a231a992bf2a1f4521043068e35eb50a6"></a> |
||||||
|
virtual void </td><td class="memItemRight" valign="bottom"><b>setPinMode</b> (int pin, int mode)</td></tr> |
||||||
|
<tr class="separator:a231a992bf2a1f4521043068e35eb50a6"><td class="memSeparator" colspan="2"> </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 </td><td class="memItemRight" valign="bottom"><b>previous_millis</b></td></tr> |
||||||
|
<tr class="separator:a223ab27b8094acd12d77a3a9145f56c9"><td class="memSeparator" colspan="2"> </td></tr> |
||||||
|
<tr class="memitem:a8c1991db9415ccc5acf9b24779b332c7"><td class="memItemLeft" align="right" valign="top"><a id="a8c1991db9415ccc5acf9b24779b332c7"></a> |
||||||
|
uint16_t </td><td class="memItemRight" valign="bottom"><b>interval_millis</b></td></tr> |
||||||
|
<tr class="separator:a8c1991db9415ccc5acf9b24779b332c7"><td class="memSeparator" colspan="2"> </td></tr> |
||||||
|
<tr class="memitem:af013db8b02e1e252eb60dd5b40d5480b"><td class="memItemLeft" align="right" valign="top"><a id="af013db8b02e1e252eb60dd5b40d5480b"></a> |
||||||
|
uint8_t </td><td class="memItemRight" valign="bottom"><b>state</b></td></tr> |
||||||
|
<tr class="separator:af013db8b02e1e252eb60dd5b40d5480b"><td class="memSeparator" colspan="2"> </td></tr> |
||||||
|
<tr class="memitem:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="memItemLeft" align="right" valign="top"><a id="a1cb79cb0ba2379cd12cc7c098d97053a"></a> |
||||||
|
uint8_t </td><td class="memItemRight" valign="bottom"><b>pin</b></td></tr> |
||||||
|
<tr class="separator:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="memSeparator" colspan="2"> </td></tr> |
||||||
|
<tr class="memitem:ad5aa630c50e7b783bac50aad0385262e"><td class="memItemLeft" align="right" valign="top"><a id="ad5aa630c50e7b783bac50aad0385262e"></a> |
||||||
|
unsigned long </td><td class="memItemRight" valign="bottom"><b>stateChangeLastTime</b></td></tr> |
||||||
|
<tr class="separator:ad5aa630c50e7b783bac50aad0385262e"><td class="memSeparator" colspan="2"> </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 & Destructor Documentation</h2> |
||||||
|
<a id="aa62a2e2b5ad0ee6913a95f2f2a0e7606"></a> |
||||||
|
<h2 class="memtitle"><span class="permalink"><a href="#aa62a2e2b5ad0ee6913a95f2f2a0e7606">◆ </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">◆ </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 </td> |
||||||
|
<td class="paramname"><em>pin</em>, </td> |
||||||
|
</tr> |
||||||
|
<tr> |
||||||
|
<td class="paramkey"></td> |
||||||
|
<td></td> |
||||||
|
<td class="paramtype">int </td> |
||||||
|
<td class="paramname"><em>mode</em> </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">◆ </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 </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'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">◆ </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">◆ </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 </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">◆ </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">◆ </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'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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,82 @@ |
|||||||
|
<!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">  b  </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>   </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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 132 B |
@ -0,0 +1,77 @@ |
|||||||
|
<!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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 746 B |
After Width: | Height: | Size: 3.7 KiB |
@ -0,0 +1,97 @@ |
|||||||
|
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('▼'); |
||||||
|
$(this).show(); |
||||||
|
} else if (l==level+1) { |
||||||
|
i.removeClass('iconfclosed iconfopen').addClass('iconfclosed'); |
||||||
|
a.html('►'); |
||||||
|
$(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('►'); |
||||||
|
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('▼'); |
||||||
|
// 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('►'); |
||||||
|
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'); |
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,83 @@ |
|||||||
|
<!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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,79 @@ |
|||||||
|
<!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;"> </span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">▼</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')"> </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;"> </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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
After Width: | Height: | Size: 616 B |
After Width: | Height: | Size: 597 B |
@ -0,0 +1,101 @@ |
|||||||
|
<!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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,101 @@ |
|||||||
|
<!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"> |
||||||
|
 <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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,103 @@ |
|||||||
|
<!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 & 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 <Bounce2.h></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  <a href="http://www.doxygen.org/index.html"> |
||||||
|
<img class="footer" src="doxygen.png" alt="doxygen"/> |
||||||
|
</a> 1.8.13 |
||||||
|
</small></address> |
||||||
|
</body> |
||||||
|
</html> |
@ -0,0 +1,26 @@ |
|||||||
|
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(); |
||||||
|
} |
@ -0,0 +1,11 @@ |
|||||||
|
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"}]} |
After Width: | Height: | Size: 153 B |
After Width: | Height: | Size: 95 B |
After Width: | Height: | Size: 98 B |
After Width: | Height: | Size: 123 B |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['attach',['attach',['../class_bounce.html#aba08e592941465d033e3eba3dde66eaf',1,'Bounce::attach(int pin, int mode)'],['../class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e',1,'Bounce::attach(int pin)']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,5 @@ |
|||||||
|
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,'']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['duration',['duration',['../class_bounce.html#a62412d814d36102ab3d285e801d5d29a',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,5 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['fallingedge',['fallingEdge',['../class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f',1,'Bounce']]], |
||||||
|
['fell',['fell',['../class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['interval',['interval',['../class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,6 @@ |
|||||||
|
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']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['update',['update',['../class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['bounce',['Bounce',['../class_bounce.html',1,'']]] |
||||||
|
]; |
After Width: | Height: | Size: 273 B |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['attach',['attach',['../class_bounce.html#aba08e592941465d033e3eba3dde66eaf',1,'Bounce::attach(int pin, int mode)'],['../class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e',1,'Bounce::attach(int pin)']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
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)']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['duration',['duration',['../class_bounce.html#a62412d814d36102ab3d285e801d5d29a',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,5 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['fallingedge',['fallingEdge',['../class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f',1,'Bounce']]], |
||||||
|
['fell',['fell',['../class_bounce.html#abfbb0910f5b1ec4e25315cff26dd6289',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['interval',['interval',['../class_bounce.html#a2c6e68bf749497c597a9437b488b3d7c',1,'Bounce']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,6 @@ |
|||||||
|
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']]] |
||||||
|
]; |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['update',['update',['../class_bounce.html#ab36d7b83bf32e0935a0c2c6a05096441',1,'Bounce']]] |
||||||
|
]; |
After Width: | Height: | Size: 563 B |
@ -0,0 +1,12 @@ |
|||||||
|
<!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> |
@ -0,0 +1,26 @@ |
|||||||
|
<!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> |
@ -0,0 +1,4 @@ |
|||||||
|
var searchData= |
||||||
|
[ |
||||||
|
['bounce_202',['BOUNCE 2',['../index.html',1,'']]] |
||||||
|
]; |
@ -0,0 +1,271 @@ |
|||||||
|
/*---------------- 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; |
||||||
|
} |
||||||
|
|
@ -0,0 +1,791 @@ |
|||||||
|
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='•'; |
||||||
|
} |
||||||
|
else |
||||||
|
{ |
||||||
|
node.innerHTML=' '; |
||||||
|
} |
||||||
|
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"> </span>'+indexSectionLabels[key]; |
||||||
|
results.appendChild(link); |
||||||
|
} |
||||||
|
searchBox.OnSelectItem(0); |
||||||
|
} |
||||||
|
|
After Width: | Height: | Size: 604 B |
After Width: | Height: | Size: 158 B |
After Width: | Height: | Size: 612 B |
@ -0,0 +1,24 @@ |
|||||||
|
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" |
||||||
|
}; |
||||||
|
|
After Width: | Height: | Size: 314 B |
After Width: | Height: | Size: 853 B |
After Width: | Height: | Size: 845 B |
After Width: | Height: | Size: 142 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 177 B |
After Width: | Height: | Size: 184 B |
@ -0,0 +1 @@ |
|||||||
|
<meta http-equiv="refresh" content="0; URL='files/index.html'" /> |
@ -0,0 +1,48 @@ |
|||||||
|
|
||||||
|
/*
|
||||||
|
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 ); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
@ -0,0 +1,64 @@ |
|||||||
|
|
||||||
|
/*
|
||||||
|
DESCRIPTION |
||||||
|
==================== |
||||||
|
Simple example of the Bounce library that switches the debug LED when
|
||||||
|
either of 2 buttons are pressed. |
||||||
|
*/ |
||||||
|
|
||||||
|
// Include the Bounce2 library found here :
|
||||||
|
// https://github.com/thomasfredericks/Bounce2
|
||||||
|
#include <Bounce2.h> |
||||||
|
|
||||||
|
#define BUTTON_PIN_1 2 |
||||||
|
#define BUTTON_PIN_2 3 |
||||||
|
|
||||||
|
|
||||||
|
#define LED_PIN 13 |
||||||
|
|
||||||
|
// Instantiate a Bounce object
|
||||||
|
Bounce debouncer1 = Bounce();
|
||||||
|
|
||||||
|
// Instantiate another Bounce object
|
||||||
|
Bounce debouncer2 = Bounce();
|
||||||
|
|
||||||
|
void setup() { |
||||||
|
|
||||||
|
// Setup the first button with an internal pull-up :
|
||||||
|
pinMode(BUTTON_PIN_1,INPUT_PULLUP); |
||||||
|
// After setting up the button, setup the Bounce instance :
|
||||||
|
debouncer1.attach(BUTTON_PIN_1); |
||||||
|
debouncer1.interval(5); // interval in ms
|
||||||
|
|
||||||
|
// Setup the second button with an internal pull-up :
|
||||||
|
pinMode(BUTTON_PIN_2,INPUT_PULLUP); |
||||||
|
// After setting up the button, setup the Bounce instance :
|
||||||
|
debouncer2.attach(BUTTON_PIN_2); |
||||||
|
debouncer2.interval(5); // interval in ms
|
||||||
|
|
||||||
|
|
||||||
|
//Setup the LED :
|
||||||
|
pinMode(LED_PIN,OUTPUT); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void loop() { |
||||||
|
// Update the Bounce instances :
|
||||||
|
debouncer1.update(); |
||||||
|
debouncer2.update(); |
||||||
|
|
||||||
|
// Get the updated value :
|
||||||
|
int value1 = debouncer1.read(); |
||||||
|
int value2 = debouncer2.read(); |
||||||
|
|
||||||
|
// Turn on the LED if either button is pressed :
|
||||||
|
if ( value1 == LOW || value2 == LOW ) { |
||||||
|
digitalWrite(LED_PIN, HIGH ); |
||||||
|
}
|
||||||
|
else { |
||||||
|
digitalWrite(LED_PIN, LOW ); |
||||||
|
} |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
@ -0,0 +1,56 @@ |
|||||||
|
// 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
|
||||||
|
|
||||||
|
// Include the Bounce2 library found here :
|
||||||
|
// https://github.com/thomasfredericks/Bounce2
|
||||||
|
#include <Bounce2.h> |
||||||
|
|
||||||
|
#define LED_PIN 13 |
||||||
|
|
||||||
|
#define NUM_BUTTONS 8 |
||||||
|
const uint8_t BUTTON_PINS[NUM_BUTTONS] = {2, 3, 4, 5, 6, 7, 8, 9}; |
||||||
|
|
||||||
|
int ledState = LOW; |
||||||
|
|
||||||
|
Bounce * buttons = new Bounce[NUM_BUTTONS]; |
||||||
|
|
||||||
|
void setup() { |
||||||
|
|
||||||
|
for (int i = 0; i < NUM_BUTTONS; i++) { |
||||||
|
buttons[i].attach( BUTTON_PINS[i] , INPUT_PULLUP ); //setup the bounce instance for the current button
|
||||||
|
buttons[i].interval(25); // interval in ms
|
||||||
|
} |
||||||
|
|
||||||
|
// Setup the LED :
|
||||||
|
pinMode(LED_PIN, OUTPUT); |
||||||
|
digitalWrite(LED_PIN, ledState); |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void loop() { |
||||||
|
|
||||||
|
bool needToToggleLed = false; |
||||||
|
|
||||||
|
|
||||||
|
for (int i = 0; i < NUM_BUTTONS; i++) { |
||||||
|
// Update the Bounce instance :
|
||||||
|
buttons[i].update(); |
||||||
|
// If it fell, flag the need to toggle the LED
|
||||||
|
if ( buttons[i].fell() ) { |
||||||
|
needToToggleLed = true; |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// if a LED toggle has been flagged :
|
||||||
|
if ( needToToggleLed ) { |
||||||
|
// Toggle LED state :
|
||||||
|
ledState = !ledState; |
||||||
|
digitalWrite(LED_PIN, ledState); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
@ -0,0 +1,37 @@ |
|||||||
|
|
||||||
|
// 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
|
||||||
|
} |
||||||
|
} |
||||||
|
|
@ -0,0 +1,53 @@ |
|||||||
|
/*
|
||||||
|
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,86 @@ |
|||||||
|
|
||||||
|
/*
|
||||||
|
DESCRIPTION |
||||||
|
==================== |
||||||
|
Example of the bounce library that shows how to retrigger an event when a button is held down. |
||||||
|
In this case, the debug LED will blink every 500 ms as long as the button is held down. |
||||||
|
Open the Serial Monitor (57600 baud) for debug messages. |
||||||
|
|
||||||
|
*/ |
||||||
|
|
||||||
|
// 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();
|
||||||
|
|
||||||
|
int buttonState; |
||||||
|
unsigned long buttonPressTimeStamp; |
||||||
|
|
||||||
|
int ledState; |
||||||
|
|
||||||
|
void setup() { |
||||||
|
|
||||||
|
Serial.begin(57600); |
||||||
|
|
||||||
|
// Setup the button
|
||||||
|
pinMode(BUTTON_PIN,INPUT); |
||||||
|
// Activate internal pull-up
|
||||||
|
digitalWrite(BUTTON_PIN,HIGH); |
||||||
|
|
||||||
|
// After setting up the button, setup debouncer
|
||||||
|
debouncer.attach(BUTTON_PIN); |
||||||
|
debouncer.interval(5); |
||||||
|
|
||||||
|
//Setup the LED
|
||||||
|
pinMode(LED_PIN,OUTPUT); |
||||||
|
digitalWrite(LED_PIN,ledState); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
void loop() { |
||||||
|
// Update the debouncer and get the changed state
|
||||||
|
boolean changed = debouncer.update(); |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if ( changed ) { |
||||||
|
// Get the update value
|
||||||
|
int value = debouncer.read(); |
||||||
|
if ( value == HIGH) { |
||||||
|
ledState = LOW; |
||||||
|
digitalWrite(LED_PIN, ledState ); |
||||||
|
|
||||||
|
buttonState = 0; |
||||||
|
Serial.println("Button released (state 0)"); |
||||||
|
|
||||||
|
} else { |
||||||
|
ledState = HIGH; |
||||||
|
digitalWrite(LED_PIN, ledState ); |
||||||
|
|
||||||
|
buttonState = 1; |
||||||
|
Serial.println("Button pressed (state 1)"); |
||||||
|
buttonPressTimeStamp = millis(); |
||||||
|
|
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
if ( buttonState == 1 ) { |
||||||
|
if ( millis() - buttonPressTimeStamp >= 500 ) { |
||||||
|
buttonPressTimeStamp = millis(); |
||||||
|
if ( ledState == HIGH ) ledState = LOW; |
||||||
|
else if ( ledState == LOW ) ledState = HIGH; |
||||||
|
digitalWrite(LED_PIN, ledState ); |
||||||
|
Serial.println("Retriggering button"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
|
After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 9.1 KiB |
After Width: | Height: | Size: 47 KiB |
@ -0,0 +1,30 @@ |
|||||||
|
####################################### |
||||||
|
# Syntax Coloring Map For Bounce2 |
||||||
|
####################################### |
||||||
|
|
||||||
|
####################################### |
||||||
|
# Datatypes (KEYWORD1) |
||||||
|
####################################### |
||||||
|
|
||||||
|
Bounce KEYWORD1 |
||||||
|
|
||||||
|
####################################### |
||||||
|
# Methods and Functions (KEYWORD2) |
||||||
|
####################################### |
||||||
|
|
||||||
|
update KEYWORD2 |
||||||
|
interval KEYWORD2 |
||||||
|
read KEYWORD2 |
||||||
|
attach KEYWORD2 |
||||||
|
rose KEYWORD2 |
||||||
|
fell KEYWORD2 |
||||||
|
duration KEYWORD2 |
||||||
|
|
||||||
|
####################################### |
||||||
|
# Instances (KEYWORD2) |
||||||
|
####################################### |
||||||
|
|
||||||
|
####################################### |
||||||
|
# Constants (LITERAL1) |
||||||
|
####################################### |
||||||
|
|
@ -0,0 +1,16 @@ |
|||||||
|
{ |
||||||
|
"name": "Bounce2", |
||||||
|
"keywords": "bounce, signal, input, ouput", |
||||||
|
"description": "Debouncing library for Arduino or Wiring", |
||||||
|
"repository": { |
||||||
|
"type": "git", |
||||||
|
"url": "https://github.com/thomasfredericks/Bounce2.git" |
||||||
|
}, |
||||||
|
"version": "2.52", |
||||||
|
"exclude": [ |
||||||
|
"*.png", |
||||||
|
"*.zip" |
||||||
|
], |
||||||
|
"frameworks": "arduino", |
||||||
|
"platforms": "*" |
||||||
|
} |
@ -0,0 +1,9 @@ |
|||||||
|
name=Bounce2 |
||||||
|
version=2.52 |
||||||
|
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. |
||||||
|
category=Signal Input/Output |
||||||
|
url=https://github.com/thomasfredericks/Bounce2 |
||||||
|
architectures=* |
@ -0,0 +1,140 @@ |
|||||||
|
// Please read Bounce2.h for information about the liscence and authors
|
||||||
|
|
||||||
|
|
||||||
|
#include "Bounce2.h" |
||||||
|
|
||||||
|
static const uint8_t DEBOUNCED_STATE = 0b00000001; |
||||||
|
static const uint8_t UNSTABLE_STATE = 0b00000010; |
||||||
|
static const uint8_t CHANGED_STATE = 0b00000100; |
||||||
|
|
||||||
|
|
||||||
|
Bounce::Bounce() |
||||||
|
: previous_millis(0) |
||||||
|
, interval_millis(10) |
||||||
|
, state(0) |
||||||
|
, pin(0) |
||||||
|
{} |
||||||
|
|
||||||
|
void Bounce::attach(int pin) { |
||||||
|
this->pin = pin; |
||||||
|
state = 0; |
||||||
|
if (readCurrentState()) { |
||||||
|
setStateFlag(DEBOUNCED_STATE | UNSTABLE_STATE); |
||||||
|
} |
||||||
|
#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() |
||||||
|
{ |
||||||
|
|
||||||
|
unsetStateFlag(CHANGED_STATE); |
||||||
|
#ifdef BOUNCE_LOCK_OUT |
||||||
|
|
||||||
|
// Ignore everything if we are locked out
|
||||||
|
if (millis() - previous_millis >= interval_millis) { |
||||||
|
bool currentState = readCurrentState(); |
||||||
|
if ( currentState != getStateFlag(DEBOUNCED_STATE) ) { |
||||||
|
previous_millis = millis(); |
||||||
|
changeState(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
#elif defined BOUNCE_WITH_PROMPT_DETECTION |
||||||
|
// Read the state of the switch port into a temporary variable.
|
||||||
|
bool readState = readCurrentState(); |
||||||
|
|
||||||
|
|
||||||
|
if ( readState != getStateFlag(DEBOUNCED_STATE) ) { |
||||||
|
// We have seen a change from the current button state.
|
||||||
|
|
||||||
|
if ( millis() - previous_millis >= interval_millis ) { |
||||||
|
// We have passed the time threshold, so a new change of state is allowed.
|
||||||
|
// set the STATE_CHANGED flag and the new DEBOUNCED_STATE.
|
||||||
|
// This will be prompt as long as there has been greater than interval_misllis ms since last change of input.
|
||||||
|
// Otherwise debounced state will not change again until bouncing is stable for the timeout period.
|
||||||
|
changeState(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// If the readState is different from previous readState, reset the debounce timer - as input is still unstable
|
||||||
|
// and we want to prevent new button state changes until the previous one has remained stable for the timeout.
|
||||||
|
if ( readState != getStateFlag(UNSTABLE_STATE) ) { |
||||||
|
// Update Unstable Bit to macth readState
|
||||||
|
toggleStateFlag(UNSTABLE_STATE); |
||||||
|
previous_millis = millis(); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
#else |
||||||
|
// Read the state of the switch in a temporary variable.
|
||||||
|
bool currentState = readCurrentState(); |
||||||
|
|
||||||
|
|
||||||
|
// If the reading is different from last reading, reset the debounce counter
|
||||||
|
if ( currentState != getStateFlag(UNSTABLE_STATE) ) { |
||||||
|
previous_millis = millis(); |
||||||
|
toggleStateFlag(UNSTABLE_STATE); |
||||||
|
} else |
||||||
|
if ( millis() - previous_millis >= interval_millis ) { |
||||||
|
// We have passed the threshold time, so the input is now stable
|
||||||
|
// If it is different from last state, set the STATE_CHANGED flag
|
||||||
|
if (currentState != getStateFlag(DEBOUNCED_STATE) ) { |
||||||
|
previous_millis = millis(); |
||||||
|
|
||||||
|
|
||||||
|
changeState(); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
#endif |
||||||
|
|
||||||
|
return getStateFlag(CHANGED_STATE);
|
||||||
|
|
||||||
|
} |
||||||
|
/*
|
||||||
|
// WIP HELD
|
||||||
|
unsigned long Bounce::held() { |
||||||
|
return durationOfPreviousState; |
||||||
|
} |
||||||
|
*/ |
||||||
|
unsigned long Bounce::duration() { |
||||||
|
return (millis() - stateChangeLastTime); |
||||||
|
} |
||||||
|
|
||||||
|
inline void Bounce::changeState() { |
||||||
|
toggleStateFlag(DEBOUNCED_STATE); |
||||||
|
setStateFlag(CHANGED_STATE) ; |
||||||
|
// WIP HELD : durationOfPreviousState = millis() - stateChangeLastTime;
|
||||||
|
stateChangeLastTime = millis(); |
||||||
|
} |
||||||
|
|
||||||
|
bool Bounce::read() |
||||||
|
{ |
||||||
|
return getStateFlag(DEBOUNCED_STATE); |
||||||
|
} |
||||||
|
|
||||||
|
bool Bounce::rose() |
||||||
|
{ |
||||||
|
return getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE); |
||||||
|
} |
||||||
|
|
||||||
|
bool Bounce::fell() |
||||||
|
{ |
||||||
|
return !getStateFlag(DEBOUNCED_STATE) && getStateFlag(CHANGED_STATE); |
||||||
|
} |
@ -0,0 +1,194 @@ |
|||||||
|
/*
|
||||||
|
The MIT License (MIT) |
||||||
|
|
||||||
|
Copyright (c) 2013 thomasfredericks |
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy of |
||||||
|
this software and associated documentation files (the "Software"), to deal in |
||||||
|
the Software without restriction, including without limitation the rights to |
||||||
|
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of |
||||||
|
the Software, and to permit persons to whom the Software is furnished to do so, |
||||||
|
subject to the following conditions: |
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all |
||||||
|
copies or substantial portions of the Software. |
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS |
||||||
|
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR |
||||||
|
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER |
||||||
|
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN |
||||||
|
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
||||||
|
*/ |
||||||
|
|
||||||
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||||
|
Main code by Thomas O Fredericks (tof@t-o-f.info) |
||||||
|
Previous contributions by Eric Lowry, Jim Schimpf and Tom Harkaway |
||||||
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * */ |
||||||
|
|
||||||
|
#ifndef Bounce2_h |
||||||
|
#define Bounce2_h |
||||||
|
|
||||||
|
#if defined(ARDUINO) && ARDUINO >= 100 |
||||||
|
#include "Arduino.h" |
||||||
|
#else |
||||||
|
#include "WProgram.h" |
||||||
|
#endif |
||||||
|
|
||||||
|
// Uncomment the following line for "LOCK-OUT" debounce method
|
||||||
|
//#define BOUNCE_LOCK_OUT
|
||||||
|
|
||||||
|
// Uncomment the following line for "BOUNCE_WITH_PROMPT_DETECTION" debounce method
|
||||||
|
//#define BOUNCE_WITH_PROMPT_DETECTION
|
||||||
|
|
||||||
|
#include <inttypes.h> |
||||||
|
|
||||||
|
/**
|
||||||
|
@example bounce.ino |
||||||
|
Simple example of the Bounce library that switches the debug LED when a button is pressed. |
||||||
|
*/ |
||||||
|
|
||||||
|
/**
|
||||||
|
@example change.ino |
||||||
|
This example toggles the debug LED (pin 13) on or off when a button on pin 2 is pressed. |
||||||
|
*/ |
||||||
|
|
||||||
|
/**
|
||||||
|
@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 |
||||||
|
*/ |
||||||
|
|
||||||
|
/**
|
||||||
|
@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 |
||||||
|
{ |
||||||
|
public: |
||||||
|
|
||||||
|
/*!
|
||||||
|
@brief Create an instance of the Bounce class. |
||||||
|
|
||||||
|
@code |
||||||
|
|
||||||
|
// Create an instance of the Bounce class.
|
||||||
|
Bounce() button; |
||||||
|
|
||||||
|
@endcode |
||||||
|
*/ |
||||||
|
Bounce(); |
||||||
|
|
||||||
|
|
||||||
|
/*!
|
||||||
|
@brief Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT). |
||||||
|
|
||||||
|
@param pin |
||||||
|
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); |
||||||
|
|
||||||
|
/**
|
||||||
|
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); |
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
@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(); |
||||||
|
|
||||||
|
/**
|
||||||
|
@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(); } |
||||||
|
/**
|
||||||
|
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1 |
||||||
|
*/ |
||||||
|
bool fallingEdge() { 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: |
||||||
|
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); |
||||||
|
#else |
||||||
|
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);} |
||||||
|
}; |
||||||
|
|
||||||
|
#endif |
@ -0,0 +1,332 @@ |
|||||||
|
// Based on the work by DFRobot
|
||||||
|
|
||||||
|
#include "LiquidCrystal_I2C.h" |
||||||
|
#include <inttypes.h> |
||||||
|
#if defined(ARDUINO) && ARDUINO >= 100 |
||||||
|
|
||||||
|
#include "Arduino.h" |
||||||
|
|
||||||
|
#define printIIC(args) Wire.write(args) |
||||||
|
inline size_t LiquidCrystal_I2C::write(uint8_t value) { |
||||||
|
send(value, Rs); |
||||||
|
return 1; |
||||||
|
} |
||||||
|
|
||||||
|
#else |
||||||
|
#include "WProgram.h" |
||||||
|
|
||||||
|
#define printIIC(args) Wire.send(args) |
||||||
|
inline void LiquidCrystal_I2C::write(uint8_t value) { |
||||||
|
send(value, Rs); |
||||||
|
} |
||||||
|
|
||||||
|
#endif |
||||||
|
#include "Wire.h" |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// When the display powers up, it is configured as follows:
|
||||||
|
//
|
||||||
|
// 1. Display clear
|
||||||
|
// 2. Function set:
|
||||||
|
// DL = 1; 8-bit interface data
|
||||||
|
// N = 0; 1-line display
|
||||||
|
// F = 0; 5x8 dot character font
|
||||||
|
// 3. Display on/off control:
|
||||||
|
// D = 0; Display off
|
||||||
|
// C = 0; Cursor off
|
||||||
|
// B = 0; Blinking off
|
||||||
|
// 4. Entry mode set:
|
||||||
|
// I/D = 1; Increment by 1
|
||||||
|
// S = 0; No shift
|
||||||
|
//
|
||||||
|
// Note, however, that resetting the Arduino doesn't reset the LCD, so we
|
||||||
|
// can't assume that its in that state when a sketch starts (and the
|
||||||
|
// LiquidCrystal constructor is called).
|
||||||
|
|
||||||
|
LiquidCrystal_I2C::LiquidCrystal_I2C(uint8_t lcd_Addr,uint8_t lcd_cols,uint8_t lcd_rows) |
||||||
|
{ |
||||||
|
_Addr = lcd_Addr; |
||||||
|
_cols = lcd_cols; |
||||||
|
_rows = lcd_rows; |
||||||
|
_backlightval = LCD_NOBACKLIGHT; |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::oled_init(){ |
||||||
|
_oled = true; |
||||||
|
init_priv(); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::init(){ |
||||||
|
init_priv(); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::init_priv() |
||||||
|
{ |
||||||
|
Wire.begin(); |
||||||
|
_displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS; |
||||||
|
begin(_cols, _rows);
|
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::begin(uint8_t cols, uint8_t lines, uint8_t dotsize) { |
||||||
|
if (lines > 1) { |
||||||
|
_displayfunction |= LCD_2LINE; |
||||||
|
} |
||||||
|
_numlines = lines; |
||||||
|
|
||||||
|
// for some 1 line displays you can select a 10 pixel high font
|
||||||
|
if ((dotsize != 0) && (lines == 1)) { |
||||||
|
_displayfunction |= LCD_5x10DOTS; |
||||||
|
} |
||||||
|
|
||||||
|
// SEE PAGE 45/46 FOR INITIALIZATION SPECIFICATION!
|
||||||
|
// according to datasheet, we need at least 40ms after power rises above 2.7V
|
||||||
|
// before sending commands. Arduino can turn on way befer 4.5V so we'll wait 50
|
||||||
|
delay(50);
|
||||||
|
|
||||||
|
// Now we pull both RS and R/W low to begin commands
|
||||||
|
expanderWrite(_backlightval); // reset expanderand turn backlight off (Bit 8 =1)
|
||||||
|
delay(1000); |
||||||
|
|
||||||
|
//put the LCD into 4 bit mode
|
||||||
|
// this is according to the hitachi HD44780 datasheet
|
||||||
|
// figure 24, pg 46
|
||||||
|
|
||||||
|
// we start in 8bit mode, try to set 4 bit mode
|
||||||
|
write4bits(0x03 << 4); |
||||||
|
delayMicroseconds(4500); // wait min 4.1ms
|
||||||
|
|
||||||
|
// second try
|
||||||
|
write4bits(0x03 << 4); |
||||||
|
delayMicroseconds(4500); // wait min 4.1ms
|
||||||
|
|
||||||
|
// third go!
|
||||||
|
write4bits(0x03 << 4);
|
||||||
|
delayMicroseconds(150); |
||||||
|
|
||||||
|
// finally, set to 4-bit interface
|
||||||
|
write4bits(0x02 << 4);
|
||||||
|
|
||||||
|
|
||||||
|
// set # lines, font size, etc.
|
||||||
|
command(LCD_FUNCTIONSET | _displayfunction);
|
||||||
|
|
||||||
|
// turn the display on with no cursor or blinking default
|
||||||
|
_displaycontrol = LCD_DISPLAYON | LCD_CURSOROFF | LCD_BLINKOFF; |
||||||
|
display(); |
||||||
|
|
||||||
|
// clear it off
|
||||||
|
clear(); |
||||||
|
|
||||||
|
// Initialize to default text direction (for roman languages)
|
||||||
|
_displaymode = LCD_ENTRYLEFT | LCD_ENTRYSHIFTDECREMENT; |
||||||
|
|
||||||
|
// set the entry mode
|
||||||
|
command(LCD_ENTRYMODESET | _displaymode); |
||||||
|
|
||||||
|
home(); |
||||||
|
|
||||||
|
} |
||||||
|
|
||||||
|
/********** high level commands, for the user! */ |
||||||
|
void LiquidCrystal_I2C::clear(){ |
||||||
|
command(LCD_CLEARDISPLAY);// clear display, set cursor position to zero
|
||||||
|
delayMicroseconds(2000); // this command takes a long time!
|
||||||
|
if (_oled) setCursor(0,0); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::home(){ |
||||||
|
command(LCD_RETURNHOME); // set cursor position to zero
|
||||||
|
delayMicroseconds(2000); // this command takes a long time!
|
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::setCursor(uint8_t col, uint8_t row){ |
||||||
|
int row_offsets[] = { 0x00, 0x40, 0x14, 0x54 }; |
||||||
|
if ( row > _numlines ) { |
||||||
|
row = _numlines-1; // we count rows starting w/0
|
||||||
|
} |
||||||
|
command(LCD_SETDDRAMADDR | (col + row_offsets[row])); |
||||||
|
} |
||||||
|
|
||||||
|
// Turn the display on/off (quickly)
|
||||||
|
void LiquidCrystal_I2C::noDisplay() { |
||||||
|
_displaycontrol &= ~LCD_DISPLAYON; |
||||||
|
command(LCD_DISPLAYCONTROL | _displaycontrol); |
||||||
|
} |
||||||
|
void LiquidCrystal_I2C::display() { |
||||||
|
_displaycontrol |= LCD_DISPLAYON; |
||||||
|
command(LCD_DISPLAYCONTROL | _displaycontrol); |
||||||
|
} |
||||||
|
|
||||||
|
// Turns the underline cursor on/off
|
||||||
|
void LiquidCrystal_I2C::noCursor() { |
||||||
|
_displaycontrol &= ~LCD_CURSORON; |
||||||
|
command(LCD_DISPLAYCONTROL | _displaycontrol); |
||||||
|
} |
||||||
|
void LiquidCrystal_I2C::cursor() { |
||||||
|
_displaycontrol |= LCD_CURSORON; |
||||||
|
command(LCD_DISPLAYCONTROL | _displaycontrol); |
||||||
|
} |
||||||
|
|
||||||
|
// Turn on and off the blinking cursor
|
||||||
|
void LiquidCrystal_I2C::noBlink() { |
||||||
|
_displaycontrol &= ~LCD_BLINKON; |
||||||
|
command(LCD_DISPLAYCONTROL | _displaycontrol); |
||||||
|
} |
||||||
|
void LiquidCrystal_I2C::blink() { |
||||||
|
_displaycontrol |= LCD_BLINKON; |
||||||
|
command(LCD_DISPLAYCONTROL | _displaycontrol); |
||||||
|
} |
||||||
|
|
||||||
|
// These commands scroll the display without changing the RAM
|
||||||
|
void LiquidCrystal_I2C::scrollDisplayLeft(void) { |
||||||
|
command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVELEFT); |
||||||
|
} |
||||||
|
void LiquidCrystal_I2C::scrollDisplayRight(void) { |
||||||
|
command(LCD_CURSORSHIFT | LCD_DISPLAYMOVE | LCD_MOVERIGHT); |
||||||
|
} |
||||||
|
|
||||||
|
// This is for text that flows Left to Right
|
||||||
|
void LiquidCrystal_I2C::leftToRight(void) { |
||||||
|
_displaymode |= LCD_ENTRYLEFT; |
||||||
|
command(LCD_ENTRYMODESET | _displaymode); |
||||||
|
} |
||||||
|
|
||||||
|
// This is for text that flows Right to Left
|
||||||
|
void LiquidCrystal_I2C::rightToLeft(void) { |
||||||
|
_displaymode &= ~LCD_ENTRYLEFT; |
||||||
|
command(LCD_ENTRYMODESET | _displaymode); |
||||||
|
} |
||||||
|
|
||||||
|
// This will 'right justify' text from the cursor
|
||||||
|
void LiquidCrystal_I2C::autoscroll(void) { |
||||||
|
_displaymode |= LCD_ENTRYSHIFTINCREMENT; |
||||||
|
command(LCD_ENTRYMODESET | _displaymode); |
||||||
|
} |
||||||
|
|
||||||
|
// This will 'left justify' text from the cursor
|
||||||
|
void LiquidCrystal_I2C::noAutoscroll(void) { |
||||||
|
_displaymode &= ~LCD_ENTRYSHIFTINCREMENT; |
||||||
|
command(LCD_ENTRYMODESET | _displaymode); |
||||||
|
} |
||||||
|
|
||||||
|
// Allows us to fill the first 8 CGRAM locations
|
||||||
|
// with custom characters
|
||||||
|
void LiquidCrystal_I2C::createChar(uint8_t location, uint8_t charmap[]) { |
||||||
|
location &= 0x7; // we only have 8 locations 0-7
|
||||||
|
command(LCD_SETCGRAMADDR | (location << 3)); |
||||||
|
for (int i=0; i<8; i++) { |
||||||
|
write(charmap[i]); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
//createChar with PROGMEM input
|
||||||
|
void LiquidCrystal_I2C::createChar(uint8_t location, const char *charmap) { |
||||||
|
location &= 0x7; // we only have 8 locations 0-7
|
||||||
|
command(LCD_SETCGRAMADDR | (location << 3)); |
||||||
|
for (int i=0; i<8; i++) { |
||||||
|
write(pgm_read_byte_near(charmap++)); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
// Turn the (optional) backlight off/on
|
||||||
|
void LiquidCrystal_I2C::noBacklight(void) { |
||||||
|
_backlightval=LCD_NOBACKLIGHT; |
||||||
|
expanderWrite(0); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::backlight(void) { |
||||||
|
_backlightval=LCD_BACKLIGHT; |
||||||
|
expanderWrite(0); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*********** mid level commands, for sending data/cmds */ |
||||||
|
|
||||||
|
inline void LiquidCrystal_I2C::command(uint8_t value) { |
||||||
|
send(value, 0); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
/************ low level data pushing commands **********/ |
||||||
|
|
||||||
|
// write either command or data
|
||||||
|
void LiquidCrystal_I2C::send(uint8_t value, uint8_t mode) { |
||||||
|
uint8_t highnib=value&0xf0; |
||||||
|
uint8_t lownib=(value<<4)&0xf0; |
||||||
|
write4bits((highnib)|mode); |
||||||
|
write4bits((lownib)|mode);
|
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::write4bits(uint8_t value) { |
||||||
|
expanderWrite(value); |
||||||
|
pulseEnable(value); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::expanderWrite(uint8_t _data){
|
||||||
|
Wire.beginTransmission(_Addr); |
||||||
|
printIIC((int)(_data) | _backlightval); |
||||||
|
Wire.endTransmission();
|
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::pulseEnable(uint8_t _data){ |
||||||
|
expanderWrite(_data | En); // En high
|
||||||
|
delayMicroseconds(1); // enable pulse must be >450ns
|
||||||
|
|
||||||
|
expanderWrite(_data & ~En); // En low
|
||||||
|
delayMicroseconds(50); // commands need > 37us to settle
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Alias functions
|
||||||
|
|
||||||
|
void LiquidCrystal_I2C::cursor_on(){ |
||||||
|
cursor(); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::cursor_off(){ |
||||||
|
noCursor(); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::blink_on(){ |
||||||
|
blink(); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::blink_off(){ |
||||||
|
noBlink(); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::load_custom_character(uint8_t char_num, uint8_t *rows){ |
||||||
|
createChar(char_num, rows); |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::setBacklight(uint8_t new_val){ |
||||||
|
if(new_val){ |
||||||
|
backlight(); // turn backlight on
|
||||||
|
}else{ |
||||||
|
noBacklight(); // turn backlight off
|
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
void LiquidCrystal_I2C::printstr(const char c[]){ |
||||||
|
//This function is not identical to the function used for "real" I2C displays
|
||||||
|
//it's here so the user sketch doesn't have to be changed
|
||||||
|
print(c); |
||||||
|
} |
||||||
|
|
||||||
|
|
||||||
|
// unsupported API functions
|
||||||
|
#pragma GCC diagnostic push |
||||||
|
#pragma GCC diagnostic ignored "-Wunused-parameter" |
||||||
|
void LiquidCrystal_I2C::off(){} |
||||||
|
void LiquidCrystal_I2C::on(){} |
||||||
|
void LiquidCrystal_I2C::setDelay (int cmdDelay,int charDelay) {} |
||||||
|
uint8_t LiquidCrystal_I2C::status(){return 0;} |
||||||
|
uint8_t LiquidCrystal_I2C::keypad (){return 0;} |
||||||
|
uint8_t LiquidCrystal_I2C::init_bargraph(uint8_t graphtype){return 0;} |
||||||
|
void LiquidCrystal_I2C::draw_horizontal_graph(uint8_t row, uint8_t column, uint8_t len, uint8_t pixel_col_end){} |
||||||
|
void LiquidCrystal_I2C::draw_vertical_graph(uint8_t row, uint8_t column, uint8_t len, uint8_t pixel_row_end){} |
||||||
|
void LiquidCrystal_I2C::setContrast(uint8_t new_val){} |
||||||
|
#pragma GCC diagnostic pop |
||||||
|
|