<divclass="line"><aname="l00006"></a><spanclass="lineno"> 6</span> <spanclass="comment"> Permission is hereby granted, free of charge, to any person obtaining a copy of</span></div>
<divclass="line"><aname="l00007"></a><spanclass="lineno"> 7</span> <spanclass="comment"> this software and associated documentation files (the "Software"), to deal in</span></div>
<divclass="line"><aname="l00008"></a><spanclass="lineno"> 8</span> <spanclass="comment"> the Software without restriction, including without limitation the rights to</span></div>
<divclass="line"><aname="l00010"></a><spanclass="lineno"> 10</span> <spanclass="comment"> the Software, and to permit persons to whom the Software is furnished to do so,</span></div>
<divclass="line"><aname="l00011"></a><spanclass="lineno"> 11</span> <spanclass="comment"> subject to the following conditions:</span></div>
<divclass="line"><aname="l00013"></a><spanclass="lineno"> 13</span> <spanclass="comment"> The above copyright notice and this permission notice shall be included in all</span></div>
<divclass="line"><aname="l00014"></a><spanclass="lineno"> 14</span> <spanclass="comment"> copies or substantial portions of the Software.</span></div>
<divclass="line"><aname="l00016"></a><spanclass="lineno"> 16</span> <spanclass="comment"> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div>
<divclass="line"><aname="l00017"></a><spanclass="lineno"> 17</span> <spanclass="comment"> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS</span></div>
<divclass="line"><aname="l00018"></a><spanclass="lineno"> 18</span> <spanclass="comment"> FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR</span></div>
<divclass="line"><aname="l00019"></a><spanclass="lineno"> 19</span> <spanclass="comment"> COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER</span></div>
<divclass="line"><aname="l00020"></a><spanclass="lineno"> 20</span> <spanclass="comment"> IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN</span></div>
<divclass="line"><aname="l00021"></a><spanclass="lineno"> 21</span> <spanclass="comment"> CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</span></div>
<divclass="line"><aname="l00025"></a><spanclass="lineno"> 25</span> <spanclass="comment"> Main code by Thomas O Fredericks (tof@t-o-f.info)</span></div>
<divclass="line"><aname="l00026"></a><spanclass="lineno"> 26</span> <spanclass="comment"> Previous contributions by Eric Lowry, Jim Schimpf and Tom Harkaway</span></div>
<divclass="line"><aname="l00039"></a><spanclass="lineno"> 39</span> <spanclass="comment">// Uncomment the following line for "LOCK-OUT" debounce method</span></div>
<divclass="line"><aname="l00042"></a><spanclass="lineno"> 42</span> <spanclass="comment">// Uncomment the following line for "BOUNCE_WITH_PROMPT_DETECTION" debounce method</span></div>
<divclass="line"><aname="l00064"></a><spanclass="lineno"> 64</span> <spanclass="comment">// Note : this is private as it migh change in the futur</span></div>
<divclass="line"><aname="l00066"></a><spanclass="lineno"> 66</span> <spanclass="keyword">static</span><spanclass="keyword">const</span> uint8_t DEBOUNCED_STATE = 0b00000001; <spanclass="comment">// Final returned calculated debounced state</span></div>
<divclass="line"><aname="l00067"></a><spanclass="lineno"> 67</span> <spanclass="keyword">static</span><spanclass="keyword">const</span> uint8_t UNSTABLE_STATE = 0b00000010; <spanclass="comment">// Actual last state value behind the scene</span></div>
<divclass="line"><aname="l00068"></a><spanclass="lineno"> 68</span> <spanclass="keyword">static</span><spanclass="keyword">const</span> uint8_t CHANGED_STATE = 0b00000100; <spanclass="comment">// The DEBOUNCED_STATE has changed since last update()</span></div>
<divclass="line"><aname="l00070"></a><spanclass="lineno"> 70</span> <spanclass="comment">// Note : this is private as it migh change in the futur</span></div>
<divclass="ttc"id="aclass_debouncer_html_a930bf3945e698d77b889f6309079857d"><divclass="ttname"><ahref="class_debouncer.html#a930bf3945e698d77b889f6309079857d">Debouncer::interval</a></div><divclass="ttdeci">void interval(uint16_t interval_millis)</div><divclass="ttdoc">Sets the debounce interval in milliseconds.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:14</div></div>
<divclass="ttc"id="aclass_debouncer_html_ac6af22dc9c6ae84462fe356b7430659e"><divclass="ttname"><ahref="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">Debouncer::previousDuration</a></div><divclass="ttdeci">unsigned long previousDuration() const</div><divclass="ttdoc">Returns the duration in milliseconds of the previous state.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:103</div></div>
<divclass="ttc"id="aclass_bounce2_1_1_button_html_a1f90c647e0c75d243cdafed16c6eb28c"><divclass="ttname"><ahref="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">Bounce2::Button::getPressedState</a></div><divclass="ttdeci">bool getPressedState() const</div><divclass="ttdoc">Get the electrical state (HIGH/LOW) that corresponds to a physical press.</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:306</div></div>
<divclass="ttc"id="aclass_bounce_html_aa62a2e2b5ad0ee6913a95f2f2a0e7606"><divclass="ttname"><ahref="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce::Bounce</a></div><divclass="ttdeci">Bounce()</div><divclass="ttdoc">Create an instance of the Bounce class.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:138</div></div>
<divclass="ttc"id="aclass_debouncer_html_a462994f1f9a20876b2ee239eeee97448"><divclass="ttname"><ahref="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">Debouncer::duration</a></div><divclass="ttdeci">unsigned long duration()</div><divclass="ttdoc">DEPRECATED (i.e. do not use). Renamed currentDuration().</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:164</div></div>
<divclass="ttc"id="aclass_bounce_html_a3ef5b85db62a7a7807f0050c86cc735f"><divclass="ttname"><ahref="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">Bounce::fallingEdge</a></div><divclass="ttdeci">bool fallingEdge() const</div><divclass="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:246</div></div>
<divclass="ttc"id="aclass_debouncer_html_ab61244e043754ebdc7a156da1e1824bf"><divclass="ttname"><ahref="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">Debouncer::rose</a></div><divclass="ttdeci">bool rose() const</div><divclass="ttdoc">Returns true if pin signal transitions from low to high.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:123</div></div>
<divclass="ttc"id="aclass_bounce_html_a1cb79cb0ba2379cd12cc7c098d97053a"><divclass="ttname"><ahref="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">Bounce::pin</a></div><divclass="ttdeci">uint8_t pin</div><divclass="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:255</div></div>
<divclass="ttc"id="aclass_bounce2_1_1_button_html_a61541ae21354cb7f5cc5bc8c05db59dd"><divclass="ttname"><ahref="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">Bounce2::Button::pressed</a></div><divclass="ttdeci">bool pressed() const</div><divclass="ttdoc">Returns true if the button was physically pressed</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:320</div></div>
<divclass="ttc"id="aclass_debouncer_html_a883645ca26b4df6e5823586432104d11"><divclass="ttname"><ahref="class_debouncer.html#a883645ca26b4df6e5823586432104d11">Debouncer::currentDuration</a></div><divclass="ttdeci">unsigned long currentDuration() const</div><divclass="ttdoc">Returns the duration in milliseconds of the current state.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:107</div></div>
<divclass="ttc"id="aclass_bounce2_1_1_button_html_a18710b645862d2b8f058a73aabbaf7ad"><divclass="ttname"><ahref="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button::Button</a></div><divclass="ttdeci">Button()</div><divclass="ttdoc">Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical...</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:290</div></div>
<divclass="ttc"id="aclass_bounce_html"><divclass="ttname"><ahref="class_bounce.html">Bounce</a></div><divclass="ttdoc">The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:184</div></div>
<divclass="ttc"id="aclass_bounce_html_a114878745aa1f29d3c0c293538280646"><divclass="ttname"><ahref="class_bounce.html#a114878745aa1f29d3c0c293538280646">Bounce::getPin</a></div><divclass="ttdeci">int getPin() const</div><divclass="ttdoc">Return pin that this Bounce is attached to.</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:229</div></div>
<divclass="ttc"id="aclass_debouncer_html"><divclass="ttname"><ahref="class_debouncer.html">Debouncer</a></div><divclass="ttdoc">The Debouce class. Just the deboucing code separated from all harware.</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:62</div></div>
<divclass="ttc"id="aclass_bounce2_1_1_button_html_a3c88b7938b26bca9dc2c7e72aedc442e"><divclass="ttname"><ahref="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button::setPressedState</a></div><divclass="ttdeci">void setPressedState(bool state)</div><divclass="ttdoc">Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default,...</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:299</div></div>
<divclass="ttc"id="aclass_debouncer_html_a80315de311b855f9787b4b6d5b7899e0"><divclass="ttname"><ahref="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">Debouncer::fell</a></div><divclass="ttdeci">bool fell() const</div><divclass="ttdoc">Returns true if pin signal transitions from high to low.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:128</div></div>
<divclass="ttc"id="aclass_bounce2_1_1_button_html_ae9bc1365cf132e57feda6dff112edbad"><divclass="ttname"><ahref="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">Bounce2::Button::released</a></div><divclass="ttdeci">bool released() const</div><divclass="ttdoc">Returns true if the button was physically released</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:327</div></div>
<divclass="ttc"id="aclass_bounce_html_aba08e592941465d033e3eba3dde66eaf"><divclass="ttname"><ahref="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">Bounce::attach</a></div><divclass="ttdeci">void attach(int pin, int mode)</div><divclass="ttdoc">Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT).</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:149</div></div>
<divclass="ttc"id="aclass_bounce2_1_1_button_html_a73c7c9ef574afe8bf1a9f3eb492bfa7f"><divclass="ttname"><ahref="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">Bounce2::Button::isPressed</a></div><divclass="ttdeci">bool isPressed() const</div><divclass="ttdoc">Returns true if the button is currently physically pressed.</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:313</div></div>
<divclass="ttc"id="aclass_debouncer_html_aa5fcde9156f700c362fd49af5dd92ecd"><divclass="ttname"><ahref="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">Debouncer::read</a></div><divclass="ttdeci">bool read() const</div><divclass="ttdoc">Returns the pin's state (HIGH or LOW).</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:118</div></div>
<divclass="ttc"id="aclass_bounce_html_adff02eed264355c2bf90d131768f84c2"><divclass="ttname"><ahref="class_bounce.html#adff02eed264355c2bf90d131768f84c2">Bounce::risingEdge</a></div><divclass="ttdeci">bool risingEdge() const</div><divclass="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:241</div></div>
<divclass="ttc"id="aclass_debouncer_html_a1bbd627f9d8809b5ee9e64e9fb21e248"><divclass="ttname"><ahref="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">Debouncer::changed</a></div><divclass="ttdeci">bool changed() const</div><divclass="ttdoc">Returns true if the state changed on last update.</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:130</div></div>
<divclass="ttc"id="anamespace_bounce2_html"><divclass="ttname"><ahref="namespace_bounce2.html">Bounce2</a></div><divclass="ttdoc">The Debouncer:Bounce:Button class. The Button class matches an electrical state to a physical action.</div><divclass="ttdef"><b>Definition:</b> Bounce2.h:273</div></div>
<divclass="ttc"id="aclass_debouncer_html_a34c46ca04d4178933cc0049436d10fe6"><divclass="ttname"><ahref="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer::Debouncer</a></div><divclass="ttdeci">Debouncer()</div><divclass="ttdoc">Create an instance of the Debounce class.</div><divclass="ttdef"><b>Definition:</b> Bounce2.cpp:10</div></div>