class_debouncer.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>Bounce2: Debouncer Class Reference</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. </head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">Bounce2
  25. </div>
  26. </td>
  27. </tr>
  28. </tbody>
  29. </table>
  30. </div>
  31. <!-- end header part -->
  32. <!-- Generated by Doxygen 1.8.17 -->
  33. <script type="text/javascript">
  34. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. /* @license-end */
  37. </script>
  38. <script type="text/javascript" src="menudata.js"></script>
  39. <script type="text/javascript" src="menu.js"></script>
  40. <script type="text/javascript">
  41. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  42. $(function() {
  43. initMenu('',true,false,'search.php','Search');
  44. $(document).ready(function() { init_search(); });
  45. });
  46. /* @license-end */</script>
  47. <div id="main-nav"></div>
  48. <!-- window showing the filter options -->
  49. <div id="MSearchSelectWindow"
  50. onmouseover="return searchBox.OnSearchSelectShow()"
  51. onmouseout="return searchBox.OnSearchSelectHide()"
  52. onkeydown="return searchBox.OnSearchSelectKey(event)">
  53. </div>
  54. <!-- iframe showing the search results (closed by default) -->
  55. <div id="MSearchResultsWindow">
  56. <iframe src="javascript:void(0)" frameborder="0"
  57. name="MSearchResults" id="MSearchResults">
  58. </iframe>
  59. </div>
  60. </div><!-- top -->
  61. <div class="header">
  62. <div class="summary">
  63. <a href="#pub-methods">Public Member Functions</a> &#124;
  64. <a href="#pro-methods">Protected Member Functions</a> &#124;
  65. <a href="#pro-attribs">Protected Attributes</a> &#124;
  66. <a href="class_debouncer-members.html">List of all members</a> </div>
  67. <div class="headertitle">
  68. <div class="title">Debouncer Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
  69. </div><!--header-->
  70. <div class="contents">
  71. <p>The Debouce class. Just the deboucing code separated from all harware.
  72. <a href="class_debouncer.html#details">More...</a></p>
  73. <p><code>#include &lt;<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a>&gt;</code></p>
  74. <div class="dynheader">
  75. Inheritance diagram for Debouncer:</div>
  76. <div class="dyncontent">
  77. <div class="center">
  78. <img src="class_debouncer.png" usemap="#Debouncer_map" alt=""/>
  79. <map id="Debouncer_map" name="Debouncer_map">
  80. <area href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,..." alt="Bounce" shape="rect" coords="0,56,103,80"/>
  81. <area href="class_bounce2_1_1_button.html" alt="Bounce2::Button" shape="rect" coords="0,112,103,136"/>
  82. </map>
  83. </div></div>
  84. <table class="memberdecls">
  85. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  86. Public Member Functions</h2></td></tr>
  87. <tr class="memitem:a34c46ca04d4178933cc0049436d10fe6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a> ()</td></tr>
  88. <tr class="memdesc:a34c46ca04d4178933cc0049436d10fe6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an instance of the Debounce class. <a href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">More...</a><br /></td></tr>
  89. <tr class="separator:a34c46ca04d4178933cc0049436d10fe6"><td class="memSeparator" colspan="2">&#160;</td></tr>
  90. <tr class="memitem:a930bf3945e698d77b889f6309079857d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a> (uint16_t interval_millis)</td></tr>
  91. <tr class="memdesc:a930bf3945e698d77b889f6309079857d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the debounce interval in milliseconds. <a href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">More...</a><br /></td></tr>
  92. <tr class="separator:a930bf3945e698d77b889f6309079857d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  93. <tr class="memitem:a72f3e8d483555031d2ac21b0b7702c06"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a> ()</td></tr>
  94. <tr class="memdesc:a72f3e8d483555031d2ac21b0b7702c06"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the pin's state. <a href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">More...</a><br /></td></tr>
  95. <tr class="separator:a72f3e8d483555031d2ac21b0b7702c06"><td class="memSeparator" colspan="2">&#160;</td></tr>
  96. <tr class="memitem:aa5fcde9156f700c362fd49af5dd92ecd"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a> () const</td></tr>
  97. <tr class="memdesc:aa5fcde9156f700c362fd49af5dd92ecd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin's state (HIGH or LOW). <a href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">More...</a><br /></td></tr>
  98. <tr class="separator:aa5fcde9156f700c362fd49af5dd92ecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  99. <tr class="memitem:a80315de311b855f9787b4b6d5b7899e0"><td class="memItemLeft" align="right" valign="top"><a id="a80315de311b855f9787b4b6d5b7899e0"></a>
  100. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a> () const</td></tr>
  101. <tr class="memdesc:a80315de311b855f9787b4b6d5b7899e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
  102. <tr class="separator:a80315de311b855f9787b4b6d5b7899e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  103. <tr class="memitem:ab61244e043754ebdc7a156da1e1824bf"><td class="memItemLeft" align="right" valign="top"><a id="ab61244e043754ebdc7a156da1e1824bf"></a>
  104. bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a> () const</td></tr>
  105. <tr class="memdesc:ab61244e043754ebdc7a156da1e1824bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
  106. <tr class="separator:ab61244e043754ebdc7a156da1e1824bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
  107. <tr class="memitem:a1bbd627f9d8809b5ee9e64e9fb21e248"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a> () const</td></tr>
  108. <tr class="memdesc:a1bbd627f9d8809b5ee9e64e9fb21e248"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the state changed on last update. <a href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">More...</a><br /></td></tr>
  109. <tr class="separator:a1bbd627f9d8809b5ee9e64e9fb21e248"><td class="memSeparator" colspan="2">&#160;</td></tr>
  110. <tr class="memitem:a883645ca26b4df6e5823586432104d11"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">currentDuration</a> () const</td></tr>
  111. <tr class="memdesc:a883645ca26b4df6e5823586432104d11"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the current state. <a href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">More...</a><br /></td></tr>
  112. <tr class="separator:a883645ca26b4df6e5823586432104d11"><td class="memSeparator" colspan="2">&#160;</td></tr>
  113. <tr class="memitem:ac6af22dc9c6ae84462fe356b7430659e"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">previousDuration</a> () const</td></tr>
  114. <tr class="memdesc:ac6af22dc9c6ae84462fe356b7430659e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the previous state. <a href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">More...</a><br /></td></tr>
  115. <tr class="separator:ac6af22dc9c6ae84462fe356b7430659e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  116. <tr class="memitem:a462994f1f9a20876b2ee239eeee97448"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a> ()</td></tr>
  117. <tr class="memdesc:a462994f1f9a20876b2ee239eeee97448"><td class="mdescLeft">&#160;</td><td class="mdescRight">DEPRECATED (i.e. do not use). Renamed <a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11" title="Returns the duration in milliseconds of the current state.">currentDuration()</a>. <a href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">More...</a><br /></td></tr>
  118. <tr class="separator:a462994f1f9a20876b2ee239eeee97448"><td class="memSeparator" colspan="2">&#160;</td></tr>
  119. </table><table class="memberdecls">
  120. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
  121. Protected Member Functions</h2></td></tr>
  122. <tr class="memitem:a38f85f1c1819a5634d93565e0459117b"><td class="memItemLeft" align="right" valign="top"><a id="a38f85f1c1819a5634d93565e0459117b"></a>
  123. void&#160;</td><td class="memItemRight" valign="bottom"><b>begin</b> ()</td></tr>
  124. <tr class="separator:a38f85f1c1819a5634d93565e0459117b"><td class="memSeparator" colspan="2">&#160;</td></tr>
  125. <tr class="memitem:a4a377599ec41b901d6a291809c60eb4f"><td class="memItemLeft" align="right" valign="top"><a id="a4a377599ec41b901d6a291809c60eb4f"></a>
  126. virtual bool&#160;</td><td class="memItemRight" valign="bottom"><b>readCurrentState</b> ()=0</td></tr>
  127. <tr class="separator:a4a377599ec41b901d6a291809c60eb4f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  128. </table><table class="memberdecls">
  129. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
  130. Protected Attributes</h2></td></tr>
  131. <tr class="memitem:afab369aec42a15595ebac695a088cccd"><td class="memItemLeft" align="right" valign="top"><a id="afab369aec42a15595ebac695a088cccd"></a>
  132. unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>previous_millis</b></td></tr>
  133. <tr class="separator:afab369aec42a15595ebac695a088cccd"><td class="memSeparator" colspan="2">&#160;</td></tr>
  134. <tr class="memitem:a25f000f08b3291f80154ec620abfe52a"><td class="memItemLeft" align="right" valign="top"><a id="a25f000f08b3291f80154ec620abfe52a"></a>
  135. uint16_t&#160;</td><td class="memItemRight" valign="bottom"><b>interval_millis</b></td></tr>
  136. <tr class="separator:a25f000f08b3291f80154ec620abfe52a"><td class="memSeparator" colspan="2">&#160;</td></tr>
  137. <tr class="memitem:a50b7f921222452bf7328ad84d09c15af"><td class="memItemLeft" align="right" valign="top"><a id="a50b7f921222452bf7328ad84d09c15af"></a>
  138. uint8_t&#160;</td><td class="memItemRight" valign="bottom"><b>state</b></td></tr>
  139. <tr class="separator:a50b7f921222452bf7328ad84d09c15af"><td class="memSeparator" colspan="2">&#160;</td></tr>
  140. <tr class="memitem:a1bcf1b5c2a67b6409fea2e8705bcab57"><td class="memItemLeft" align="right" valign="top"><a id="a1bcf1b5c2a67b6409fea2e8705bcab57"></a>
  141. unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>stateChangeLastTime</b></td></tr>
  142. <tr class="separator:a1bcf1b5c2a67b6409fea2e8705bcab57"><td class="memSeparator" colspan="2">&#160;</td></tr>
  143. <tr class="memitem:adbe8de6a1cfff329629e9136a4efea6c"><td class="memItemLeft" align="right" valign="top"><a id="adbe8de6a1cfff329629e9136a4efea6c"></a>
  144. unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPreviousState</b></td></tr>
  145. <tr class="separator:adbe8de6a1cfff329629e9136a4efea6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
  146. </table>
  147. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  148. <div class="textblock"><p>The Debouce class. Just the deboucing code separated from all harware. </p>
  149. </div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
  150. <a id="a34c46ca04d4178933cc0049436d10fe6"></a>
  151. <h2 class="memtitle"><span class="permalink"><a href="#a34c46ca04d4178933cc0049436d10fe6">&#9670;&nbsp;</a></span>Debouncer()</h2>
  152. <div class="memitem">
  153. <div class="memproto">
  154. <table class="memname">
  155. <tr>
  156. <td class="memname">Debouncer::Debouncer </td>
  157. <td>(</td>
  158. <td class="paramname"></td><td>)</td>
  159. <td></td>
  160. </tr>
  161. </table>
  162. </div><div class="memdoc">
  163. <p>Create an instance of the Debounce class. </p>
  164. </div>
  165. </div>
  166. <h2 class="groupheader">Member Function Documentation</h2>
  167. <a id="a1bbd627f9d8809b5ee9e64e9fb21e248"></a>
  168. <h2 class="memtitle"><span class="permalink"><a href="#a1bbd627f9d8809b5ee9e64e9fb21e248">&#9670;&nbsp;</a></span>changed()</h2>
  169. <div class="memitem">
  170. <div class="memproto">
  171. <table class="mlabels">
  172. <tr>
  173. <td class="mlabels-left">
  174. <table class="memname">
  175. <tr>
  176. <td class="memname">bool Debouncer::changed </td>
  177. <td>(</td>
  178. <td class="paramname"></td><td>)</td>
  179. <td> const</td>
  180. </tr>
  181. </table>
  182. </td>
  183. <td class="mlabels-right">
  184. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  185. </tr>
  186. </table>
  187. </div><div class="memdoc">
  188. <p>Returns true if the state changed on last update. </p>
  189. <dl class="section return"><dt>Returns</dt><dd>True if the state changed on last update. Otherwise, returns false. </dd></dl>
  190. </div>
  191. </div>
  192. <a id="a883645ca26b4df6e5823586432104d11"></a>
  193. <h2 class="memtitle"><span class="permalink"><a href="#a883645ca26b4df6e5823586432104d11">&#9670;&nbsp;</a></span>currentDuration()</h2>
  194. <div class="memitem">
  195. <div class="memproto">
  196. <table class="memname">
  197. <tr>
  198. <td class="memname">unsigned long Debouncer::currentDuration </td>
  199. <td>(</td>
  200. <td class="paramname"></td><td>)</td>
  201. <td> const</td>
  202. </tr>
  203. </table>
  204. </div><div class="memdoc">
  205. <p>Returns the duration in milliseconds of the current state. </p>
  206. <p>Is reset to 0 once the pin rises ( <a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf" title="Returns true if pin signal transitions from low to high.">rose()</a> ) or falls ( <a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0" title="Returns true if pin signal transitions from high to low.">fell()</a> ).</p>
  207. <dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the current state. </dd></dl>
  208. </div>
  209. </div>
  210. <a id="a462994f1f9a20876b2ee239eeee97448"></a>
  211. <h2 class="memtitle"><span class="permalink"><a href="#a462994f1f9a20876b2ee239eeee97448">&#9670;&nbsp;</a></span>duration()</h2>
  212. <div class="memitem">
  213. <div class="memproto">
  214. <table class="mlabels">
  215. <tr>
  216. <td class="mlabels-left">
  217. <table class="memname">
  218. <tr>
  219. <td class="memname">unsigned long Debouncer::duration </td>
  220. <td>(</td>
  221. <td class="paramname"></td><td>)</td>
  222. <td></td>
  223. </tr>
  224. </table>
  225. </td>
  226. <td class="mlabels-right">
  227. <span class="mlabels"><span class="mlabel">inline</span></span> </td>
  228. </tr>
  229. </table>
  230. </div><div class="memdoc">
  231. <p>DEPRECATED (i.e. do not use). Renamed <a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11" title="Returns the duration in milliseconds of the current state.">currentDuration()</a>. </p>
  232. <p>This member function is DEPRECATED will be removed next major version. DO NOT USE IT. USE <a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11" title="Returns the duration in milliseconds of the current state.">currentDuration()</a> INSTEAD. It was renamed to avoid confusion with <a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e" title="Returns the duration in milliseconds of the previous state.">previousDuration()</a>.</p>
  233. <dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the current state. </dd></dl>
  234. </div>
  235. </div>
  236. <a id="a930bf3945e698d77b889f6309079857d"></a>
  237. <h2 class="memtitle"><span class="permalink"><a href="#a930bf3945e698d77b889f6309079857d">&#9670;&nbsp;</a></span>interval()</h2>
  238. <div class="memitem">
  239. <div class="memproto">
  240. <table class="memname">
  241. <tr>
  242. <td class="memname">void Debouncer::interval </td>
  243. <td>(</td>
  244. <td class="paramtype">uint16_t&#160;</td>
  245. <td class="paramname"><em>interval_millis</em></td><td>)</td>
  246. <td></td>
  247. </tr>
  248. </table>
  249. </div><div class="memdoc">
  250. <p>Sets the debounce interval in milliseconds. </p>
  251. <dl class="params"><dt>Parameters</dt><dd>
  252. <table class="params">
  253. <tr><td class="paramname">interval_millis</td><td>The interval time in milliseconds. </td></tr>
  254. </table>
  255. </dd>
  256. </dl>
  257. </div>
  258. </div>
  259. <a id="ac6af22dc9c6ae84462fe356b7430659e"></a>
  260. <h2 class="memtitle"><span class="permalink"><a href="#ac6af22dc9c6ae84462fe356b7430659e">&#9670;&nbsp;</a></span>previousDuration()</h2>
  261. <div class="memitem">
  262. <div class="memproto">
  263. <table class="memname">
  264. <tr>
  265. <td class="memname">unsigned long Debouncer::previousDuration </td>
  266. <td>(</td>
  267. <td class="paramname"></td><td>)</td>
  268. <td> const</td>
  269. </tr>
  270. </table>
  271. </div><div class="memdoc">
  272. <p>Returns the duration in milliseconds of the previous state. </p>
  273. <p>Takes the values of <a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448" title="DEPRECATED (i.e. do not use). Renamed currentDuration().">duration()</a> once the pin changes state.</p>
  274. <dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the previous state. </dd></dl>
  275. </div>
  276. </div>
  277. <a id="aa5fcde9156f700c362fd49af5dd92ecd"></a>
  278. <h2 class="memtitle"><span class="permalink"><a href="#aa5fcde9156f700c362fd49af5dd92ecd">&#9670;&nbsp;</a></span>read()</h2>
  279. <div class="memitem">
  280. <div class="memproto">
  281. <table class="memname">
  282. <tr>
  283. <td class="memname">bool Debouncer::read </td>
  284. <td>(</td>
  285. <td class="paramname"></td><td>)</td>
  286. <td> const</td>
  287. </tr>
  288. </table>
  289. </div><div class="memdoc">
  290. <p>Returns the pin's state (HIGH or LOW). </p>
  291. <dl class="section return"><dt>Returns</dt><dd>HIGH or LOW. </dd></dl>
  292. </div>
  293. </div>
  294. <a id="a72f3e8d483555031d2ac21b0b7702c06"></a>
  295. <h2 class="memtitle"><span class="permalink"><a href="#a72f3e8d483555031d2ac21b0b7702c06">&#9670;&nbsp;</a></span>update()</h2>
  296. <div class="memitem">
  297. <div class="memproto">
  298. <table class="memname">
  299. <tr>
  300. <td class="memname">bool Debouncer::update </td>
  301. <td>(</td>
  302. <td class="paramname"></td><td>)</td>
  303. <td></td>
  304. </tr>
  305. </table>
  306. </div><div class="memdoc">
  307. <p>Updates the pin's state. </p>
  308. <p>Because <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">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_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06" title="Updates the pin&#39;s state.">update()</a> once per loop().</p>
  309. <dl class="section return"><dt>Returns</dt><dd>True if the pin changed state. </dd></dl>
  310. </div>
  311. </div>
  312. <hr/>The documentation for this class was generated from the following files:<ul>
  313. <li>src/<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a></li>
  314. <li>src/Bounce2.cpp</li>
  315. </ul>
  316. </div><!-- contents -->
  317. <!-- start footer part -->
  318. <hr class="footer"/><address class="footer"><small>
  319. Generated by &#160;<a href="http://www.doxygen.org/index.html">
  320. <img class="footer" src="doxygen.png" alt="doxygen"/>
  321. </a> 1.8.17
  322. </small></address>
  323. </body>
  324. </html>