New libraries for third-party folder.

dev
Holger Wirtz 3 years ago
parent 3155a85d4a
commit 179fb4bea6
  1. 1
      MicroDexed.ino
  2. 1
      Synth_Dexed
  3. 5
      config.h
  4. 1
      dexed_sd.cpp
  5. 8
      third-party/ArduinoJson/CHANGELOG.md
  6. 2
      third-party/ArduinoJson/CMakeLists.txt
  7. 4
      third-party/ArduinoJson/README.md
  8. 2
      third-party/ArduinoJson/appveyor.yml
  9. 1
      third-party/ArduinoJson/extras/tests/JsonDocument/CMakeLists.txt
  10. 22
      third-party/ArduinoJson/extras/tests/JsonDocument/DynamicJsonDocument.cpp
  11. 53
      third-party/ArduinoJson/extras/tests/JsonDocument/ElementProxy.cpp
  12. 40
      third-party/ArduinoJson/extras/tests/JsonDocument/MemberProxy.cpp
  13. 18
      third-party/ArduinoJson/extras/tests/JsonDocument/cast.cpp
  14. 26
      third-party/ArduinoJson/extras/tests/JsonDocument/compare.cpp
  15. 2
      third-party/ArduinoJson/library.json
  16. 2
      third-party/ArduinoJson/library.properties
  17. 4
      third-party/ArduinoJson/src/ArduinoJson/Array/ElementProxy.hpp
  18. 15
      third-party/ArduinoJson/src/ArduinoJson/Document/JsonDocument.hpp
  19. 4
      third-party/ArduinoJson/src/ArduinoJson/Object/MemberProxy.hpp
  20. 6
      third-party/ArduinoJson/src/ArduinoJson/Variant/VariantCompare.hpp
  21. 4
      third-party/ArduinoJson/src/ArduinoJson/version.hpp
  22. 283
      third-party/Bounce2/docs/files/_bounce2_8h_source.html
  23. 2
      third-party/Bounce2/docs/files/annotated.html
  24. 6
      third-party/Bounce2/docs/files/bounce_basic_8ino-example.html
  25. 22
      third-party/Bounce2/docs/files/class_bounce-members.html
  26. 96
      third-party/Bounce2/docs/files/class_bounce.html
  27. 30
      third-party/Bounce2/docs/files/class_bounce2_1_1_button-members.html
  28. 98
      third-party/Bounce2/docs/files/class_bounce2_1_1_button.html
  29. 31
      third-party/Bounce2/docs/files/class_debouncer-members.html
  30. 96
      third-party/Bounce2/docs/files/class_debouncer.html
  31. 1
      third-party/Bounce2/docs/files/files.html
  32. 28
      third-party/Bounce2/docs/files/functions.html
  33. 28
      third-party/Bounce2/docs/files/functions_func.html
  34. 2
      third-party/Bounce2/docs/files/hierarchy.html
  35. 32
      third-party/Bounce2/docs/files/index.html
  36. 3
      third-party/Bounce2/docs/files/search/all_2.js
  37. 4
      third-party/Bounce2/docs/files/search/all_3.js
  38. 4
      third-party/Bounce2/docs/files/search/all_4.js
  39. 3
      third-party/Bounce2/docs/files/search/all_5.js
  40. 4
      third-party/Bounce2/docs/files/search/all_6.js
  41. 6
      third-party/Bounce2/docs/files/search/all_7.js
  42. 8
      third-party/Bounce2/docs/files/search/all_8.js
  43. 2
      third-party/Bounce2/docs/files/search/all_9.js
  44. 2
      third-party/Bounce2/docs/files/search/all_a.js
  45. 4
      third-party/Bounce2/docs/files/search/classes_0.js
  46. 2
      third-party/Bounce2/docs/files/search/classes_1.js
  47. 2
      third-party/Bounce2/docs/files/search/functions_0.js
  48. 4
      third-party/Bounce2/docs/files/search/functions_1.js
  49. 3
      third-party/Bounce2/docs/files/search/functions_2.js
  50. 4
      third-party/Bounce2/docs/files/search/functions_3.js
  51. 4
      third-party/Bounce2/docs/files/search/functions_4.js
  52. 3
      third-party/Bounce2/docs/files/search/functions_5.js
  53. 4
      third-party/Bounce2/docs/files/search/functions_6.js
  54. 4
      third-party/Bounce2/docs/files/search/functions_7.js
  55. 8
      third-party/Bounce2/docs/files/search/functions_8.js
  56. 2
      third-party/Bounce2/docs/files/search/functions_9.js
  57. 2
      third-party/Bounce2/docs/files/search/functions_a.js
  58. 2
      third-party/Bounce2/docs/files/search/namespaces_0.js
  59. 2
      third-party/Bounce2/docs/files/search/pages_0.js
  60. 2
      third-party/Bounce2/docs/files/search/variables_0.js
  61. 4
      third-party/Bounce2/examples/bounce_basic/bounce_basic.ino
  62. 1
      third-party/Bounce2/examples/bounce_button/bounce_button.ino
  63. 67
      third-party/Bounce2/examples/more/bounce_current_duration/bounce_current_duration.ino
  64. 73
      third-party/Bounce2/examples/more/bounce_previous_duration/bounce_previous_duration.ino
  65. 88
      third-party/Bounce2/examples/more/bounce_previous_duration_blink_toggle/bounce_previous_duration_blink_toggle.ino
  66. 2
      third-party/Bounce2/keywords.txt
  67. 2
      third-party/Bounce2/library.json
  68. 2
      third-party/Bounce2/library.properties
  69. 2
      third-party/Bounce2/src/Bounce2.cpp
  70. 21
      third-party/Bounce2/src/Bounce2.h
  71. 12
      third-party/Synth_Dexed/README.md
  72. 427
      third-party/Synth_Dexed/src/compressor.h
  73. 137
      third-party/Synth_Dexed/src/dexed.cpp
  74. 29
      third-party/Synth_Dexed/src/dexed.h
  75. 149
      third-party/Synth_Dexed/src/fm_op_kernel.cpp
  76. 91
      third-party/Synth_Dexed/src/synth_dexed.cpp

@ -552,6 +552,7 @@ void setup()
Serial.println(instance_id, DEC);
#endif
create_audio_dexed_chain(instance_id);
MicroDexed[instance_id]->setCompressor(true); // just a test for enabling the compressor with default values
}
#ifdef DEBUG
for (uint8_t instance_id = 0; instance_id < NUM_DEXED; instance_id++)

@ -0,0 +1 @@
Subproject commit aed9a0994c62b5391fa5448ef8c21932caf9b817

@ -90,7 +90,7 @@
//*************************************************************************************************
//* DEBUG OUTPUT SETTINGS
//*************************************************************************************************
//#define DEBUG 1
#define DEBUG 1
//#define DEBUG_SHOW_JSON 1
#define SERIAL_SPEED 230400
#define SHOW_XRUN 1
@ -809,7 +809,8 @@
#define VOLUME_MULTIPLIER 1.4
// Buffer-size define for load/save configuration as JSON
#define JSON_BUFFER_SIZE 8192
//#define JSON_BUFFER_SIZE 8192
#define JSON_BUFFER_SIZE 4096
// Internal configuration structure
typedef struct dexed_s {

@ -652,6 +652,7 @@ bool load_sd_drumsettings_json(uint8_t number)
#endif
}
}
AudioInterrupts();
return (false);
}

@ -1,6 +1,14 @@
ArduinoJson: change log
=======================
v6.19.4 (2022-04-05)
-------
* Add `ElementProxy::memoryUsage()`
* Add `MemberProxy::memoryUsage()` (issue #1730)
* Add implicit conversion from `JsonDocument` to `JsonVariant`
* Fix comparisons operators with `const JsonDocument&`
v6.19.3 (2022-03-08)
-------

@ -10,7 +10,7 @@ if(ESP_PLATFORM)
return()
endif()
project(ArduinoJson VERSION 6.19.3)
project(ArduinoJson VERSION 6.19.4)
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
include(CTest)

@ -7,8 +7,8 @@
[![Fuzzing Status](https://oss-fuzz-build-logs.storage.googleapis.com/badges/arduinojson.svg)](https://bugs.chromium.org/p/oss-fuzz/issues/list?sort=-opened&can=1&q=proj:arduinojson)
[![LGTM Grade](https://img.shields.io/lgtm/grade/cpp/github/bblanchon/ArduinoJson?label=quality&logo=lgtm)](https://lgtm.com/projects/g/bblanchon/ArduinoJson/)
[![Coveralls branch](https://img.shields.io/coveralls/github/bblanchon/ArduinoJson/6.x?logo=coveralls)](https://coveralls.io/github/bblanchon/ArduinoJson?branch=6.x)
[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.19.3&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.19.3)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.19.3)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.19.3)
[![Arduino Library Manager](https://img.shields.io/static/v1?label=Arduino&message=v6.19.4&logo=arduino&logoColor=white&color=blue)](https://www.ardu-badge.com/ArduinoJson/6.19.4)
[![PlatformIO Registry](https://badges.registry.platformio.org/packages/bblanchon/library/ArduinoJson.svg?version=6.19.4)](https://registry.platformio.org/packages/libraries/bblanchon/ArduinoJson?version=6.19.4)
[![GitHub stars](https://img.shields.io/github/stars/bblanchon/ArduinoJson?style=flat&logo=github)](https://github.com/bblanchon/ArduinoJson/stargazers)
[![GitHub Sponsors](https://img.shields.io/github/sponsors/bblanchon?logo=github)](https://github.com/sponsors/bblanchon)

@ -1,4 +1,4 @@
version: 6.19.3.{build}
version: 6.19.4.{build}
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022

@ -5,6 +5,7 @@
add_executable(JsonDocumentTests
add.cpp
BasicJsonDocument.cpp
cast.cpp
compare.cpp
containsKey.cpp
createNested.cpp

@ -205,4 +205,26 @@ TEST_CASE("DynamicJsonDocument assignment") {
REQUIRE_JSON(doc2, "42");
REQUIRE(doc2.capacity() == 4096);
}
SECTION("Assign from MemberProxy") {
StaticJsonDocument<200> doc1;
doc1["value"] = 42;
DynamicJsonDocument doc2(4096);
doc2 = doc1["value"];
REQUIRE_JSON(doc2, "42");
REQUIRE(doc2.capacity() == 4096);
}
SECTION("Assign from ElementProxy") {
StaticJsonDocument<200> doc1;
doc1[0] = 42;
DynamicJsonDocument doc2(4096);
doc2 = doc1[0];
REQUIRE_JSON(doc2, "42");
REQUIRE(doc2.capacity() == 4096);
}
}

@ -10,7 +10,7 @@ using namespace ARDUINOJSON_NAMESPACE;
TEST_CASE("ElementProxy::add()") {
DynamicJsonDocument doc(4096);
doc.addElement();
ElementProxy<JsonDocument&> ep = doc[0];
ElementProxy<JsonDocument &> ep = doc[0];
SECTION("add(int)") {
ep.add(42);
@ -36,7 +36,7 @@ TEST_CASE("ElementProxy::add()") {
TEST_CASE("ElementProxy::clear()") {
DynamicJsonDocument doc(4096);
doc.addElement();
ElementProxy<JsonDocument&> ep = doc[0];
ElementProxy<JsonDocument &> ep = doc[0];
SECTION("size goes back to zero") {
ep.add(42);
@ -96,7 +96,7 @@ TEST_CASE("ElementProxy::operator==()") {
TEST_CASE("ElementProxy::remove()") {
DynamicJsonDocument doc(4096);
doc.addElement();
ElementProxy<JsonDocument&> ep = doc[0];
ElementProxy<JsonDocument &> ep = doc[0];
SECTION("remove(int)") {
ep.add(1);
@ -143,7 +143,7 @@ TEST_CASE("ElementProxy::remove()") {
TEST_CASE("ElementProxy::set()") {
DynamicJsonDocument doc(4096);
ElementProxy<JsonDocument&> ep = doc[0];
ElementProxy<JsonDocument &> ep = doc[0];
SECTION("set(int)") {
ep.set(42);
@ -169,7 +169,7 @@ TEST_CASE("ElementProxy::set()") {
TEST_CASE("ElementProxy::size()") {
DynamicJsonDocument doc(4096);
doc.addElement();
ElementProxy<JsonDocument&> ep = doc[0];
ElementProxy<JsonDocument &> ep = doc[0];
SECTION("returns 0") {
REQUIRE(ep.size() == 0);
@ -188,9 +188,24 @@ TEST_CASE("ElementProxy::size()") {
}
}
TEST_CASE("ElementProxy::memoryUsage()") {
DynamicJsonDocument doc(4096);
doc.addElement();
ElementProxy<JsonDocument &> ep = doc[0];
SECTION("returns 0 for null") {
REQUIRE(ep.memoryUsage() == 0);
}
SECTION("returns size for string") {
ep.set(std::string("hello"));
REQUIRE(ep.memoryUsage() == 6);
}
}
TEST_CASE("ElementProxy::operator[]") {
DynamicJsonDocument doc(4096);
ElementProxy<JsonDocument&> ep = doc[1];
ElementProxy<JsonDocument &> ep = doc[1];
SECTION("set member") {
ep["world"] = 42;
@ -204,3 +219,29 @@ TEST_CASE("ElementProxy::operator[]") {
REQUIRE(doc.as<std::string>() == "[null,[null,null,42]]");
}
}
TEST_CASE("ElementProxy cast to JsonVariantConst") {
DynamicJsonDocument doc(4096);
doc[0] = "world";
const ElementProxy<JsonDocument &> ep = doc[0];
JsonVariantConst var = ep;
CHECK(var.as<std::string>() == "world");
}
TEST_CASE("ElementProxy cast to JsonVariant") {
DynamicJsonDocument doc(4096);
doc[0] = "world";
ElementProxy<JsonDocument &> ep = doc[0];
JsonVariant var = ep;
CHECK(var.as<std::string>() == "world");
var.set("toto");
CHECK(doc.as<std::string>() == "[\"toto\"]");
}

@ -229,6 +229,20 @@ TEST_CASE("MemberProxy::size()") {
}
}
TEST_CASE("MemberProxy::memoryUsage()") {
DynamicJsonDocument doc(4096);
MemberProxy<JsonDocument &, const char *> mp = doc["hello"];
SECTION("returns 0 when null") {
REQUIRE(mp.memoryUsage() == 0);
}
SECTION("return the size for a string") {
mp.set(std::string("hello"));
REQUIRE(mp.memoryUsage() == 6);
}
}
TEST_CASE("MemberProxy::operator[]") {
DynamicJsonDocument doc(4096);
MemberProxy<JsonDocument &, const char *> mp = doc["hello"];
@ -245,3 +259,29 @@ TEST_CASE("MemberProxy::operator[]") {
REQUIRE(doc.as<std::string>() == "{\"hello\":[null,null,42]}");
}
}
TEST_CASE("MemberProxy cast to JsonVariantConst") {
DynamicJsonDocument doc(4096);
doc["hello"] = "world";
const MemberProxy<JsonDocument &, const char *> mp = doc["hello"];
JsonVariantConst var = mp;
CHECK(var.as<std::string>() == "world");
}
TEST_CASE("MemberProxy cast to JsonVariant") {
DynamicJsonDocument doc(4096);
doc["hello"] = "world";
MemberProxy<JsonDocument &, const char *> mp = doc["hello"];
JsonVariant var = mp;
CHECK(var.as<std::string>() == "world");
var.set("toto");
CHECK(doc.as<std::string>() == "{\"hello\":\"toto\"}");
}

@ -0,0 +1,18 @@
// ArduinoJson - https://arduinojson.org
// Copyright © 2014-2022, Benoit BLANCHON
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
#include <string>
TEST_CASE("Implicit cast to JsonVariant") {
StaticJsonDocument<128> doc;
doc["hello"] = "world";
JsonVariant var = doc;
CHECK(var.as<std::string>() == "{\"hello\":\"world\"}");
}

@ -75,3 +75,29 @@ TEST_CASE("StaticJsonDocument::operator==(const DynamicJsonDocument&)") {
REQUIRE(doc1 != doc2);
}
}
TEST_CASE("JsonDocument::operator==(const JsonDocument&)") {
StaticJsonDocument<256> doc1;
StaticJsonDocument<256> doc2;
const JsonDocument& ref1 = doc1;
const JsonDocument& ref2 = doc2;
SECTION("Empty") {
REQUIRE(ref1 == ref2);
REQUIRE_FALSE(ref1 != ref2);
}
SECTION("With same object") {
doc1["hello"] = "world";
doc2["hello"] = "world";
REQUIRE(ref1 == ref2);
REQUIRE_FALSE(ref1 != ref2);
}
SECTION("With different object") {
doc1["hello"] = "world";
doc2["world"] = "hello";
REQUIRE_FALSE(ref1 == ref2);
REQUIRE(ref1 != ref2);
}
}

@ -7,7 +7,7 @@
"type": "git",
"url": "https://github.com/bblanchon/ArduinoJson.git"
},
"version": "6.19.3",
"version": "6.19.4",
"authors": {
"name": "Benoit Blanchon",
"url": "https://blog.benoitblanchon.fr"

@ -1,5 +1,5 @@
name=ArduinoJson
version=6.19.3
version=6.19.4
author=Benoit Blanchon <blog.benoitblanchon.fr>
maintainer=Benoit Blanchon <blog.benoitblanchon.fr>
sentence=A simple and efficient JSON library for embedded C++.

@ -118,6 +118,10 @@ class ElementProxy : public VariantOperators<ElementProxy<TArray> >,
return getUpstreamElement().size();
}
FORCE_INLINE size_t memoryUsage() const {
return getUpstreamElement().memoryUsage();
}
template <typename TNestedKey>
VariantRef getMember(TNestedKey* key) const {
return getUpstreamElement().getMember(key);

@ -14,7 +14,8 @@
namespace ARDUINOJSON_NAMESPACE {
class JsonDocument : public Visitable {
class JsonDocument : public Visitable,
public VariantOperators<const JsonDocument&> {
public:
template <typename TVisitor>
typename TVisitor::result_type accept(TVisitor& visitor) const {
@ -295,16 +296,12 @@ class JsonDocument : public Visitable {
_data.remove(adaptString(key));
}
FORCE_INLINE operator VariantConstRef() const {
return VariantConstRef(&_data);
FORCE_INLINE operator VariantRef() {
return getVariant();
}
bool operator==(VariantConstRef rhs) const {
return getVariant() == rhs;
}
bool operator!=(VariantConstRef rhs) const {
return getVariant() != rhs;
FORCE_INLINE operator VariantConstRef() const {
return getVariant();
}
protected:

@ -94,6 +94,10 @@ class MemberProxy : public VariantOperators<MemberProxy<TObject, TStringRef> >,
return getUpstreamMember().size();
}
FORCE_INLINE size_t memoryUsage() const {
return getUpstreamMember().memoryUsage();
}
FORCE_INLINE void remove(size_t index) const {
getUpstreamMember().remove(index);
}

@ -131,9 +131,9 @@ struct RawComparer : ComparerBase {
template <typename T>
struct Comparer<T, typename enable_if<IsVisitable<T>::value>::type>
: ComparerBase {
T rhs;
const T *rhs; // TODO: should be a VariantConstRef
explicit Comparer(T value) : rhs(value) {}
explicit Comparer(const T &value) : rhs(&value) {}
CompareResult visitArray(const CollectionData &lhs) {
ArrayComparer comparer(lhs);
@ -183,7 +183,7 @@ struct Comparer<T, typename enable_if<IsVisitable<T>::value>::type>
private:
template <typename TComparer>
CompareResult accept(TComparer &comparer) {
CompareResult reversedResult = rhs.accept(comparer);
CompareResult reversedResult = rhs->accept(comparer);
switch (reversedResult) {
case COMPARE_RESULT_GREATER:
return COMPARE_RESULT_LESS;

@ -4,7 +4,7 @@
#pragma once
#define ARDUINOJSON_VERSION "6.19.3"
#define ARDUINOJSON_VERSION "6.19.4"
#define ARDUINOJSON_VERSION_MAJOR 6
#define ARDUINOJSON_VERSION_MINOR 19
#define ARDUINOJSON_VERSION_REVISION 3
#define ARDUINOJSON_VERSION_REVISION 4

@ -119,148 +119,167 @@ $(function() {
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;{</div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="comment">// Note : this is private as it migh change in the futur</span></div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t DEBOUNCED_STATE = 0b00000001;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t UNSTABLE_STATE = 0b00000010;</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t CHANGED_STATE = 0b00000100;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t DEBOUNCED_STATE = 0b00000001; <span class="comment">// Final returned calculated debounced state</span></div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t UNSTABLE_STATE = 0b00000010; <span class="comment">// Actual last state value behind the scene</span></div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> uint8_t CHANGED_STATE = 0b00000100; <span class="comment">// The DEBOUNCED_STATE has changed since last update()</span></div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> changeState();</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> setStateFlag(<span class="keyword">const</span> uint8_t flag) {state |= flag;}</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> unsetStateFlag(<span class="keyword">const</span> uint8_t flag) {state &amp;= ~flag;}</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> toggleStateFlag(<span class="keyword">const</span> uint8_t flag) {state ^= flag;}</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> getStateFlag(<span class="keyword">const</span> uint8_t flag) {<span class="keywordflow">return</span>((state &amp; flag) != 0);}</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; </div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; <a class="code" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>();</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; </div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(uint16_t interval_millis);</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>();</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; </div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a>();</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a>();</div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a>();</div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160;<span class="comment">// Note : this is private as it migh change in the futur</span></div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160;<span class="keyword">private</span>:</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> changeState();</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> setStateFlag(<span class="keyword">const</span> uint8_t flag) {state |= flag;}</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> unsetStateFlag(<span class="keyword">const</span> uint8_t flag) {state &amp;= ~flag;}</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">void</span> toggleStateFlag(<span class="keyword">const</span> uint8_t flag) {state ^= flag;}</div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> getStateFlag(<span class="keyword">const</span> uint8_t flag)<span class="keyword"> const </span>{<span class="keywordflow">return</span>((state &amp; flag) != 0);}</div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <a class="code" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>();</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; </div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(uint16_t interval_millis);</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; </div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>();</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; </div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; </div>
<div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; </div>
<div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; </div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00129"></a><span class="lineno"><a class="line" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b"> 129</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>( ) { <span class="keywordflow">return</span> getStateFlag(CHANGED_STATE); }</div>
<div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; </div>
<div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>();</div>
<div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; </div>
<div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a>(); </div>
<div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160; </div>
<div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160; <span class="keywordtype">void</span> begin();</div>
<div class="line"><a name="l00152"></a><span class="lineno"> 152</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> readCurrentState() =0;</div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> previous_millis;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; uint16_t interval_millis;</div>
<div class="line"><a name="l00155"></a><span class="lineno"> 155</span>&#160; uint8_t state;</div>
<div class="line"><a name="l00156"></a><span class="lineno"> 156</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stateChangeLastTime;</div>
<div class="line"><a name="l00157"></a><span class="lineno"> 157</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> durationOfPreviousState;</div>
<div class="line"><a name="l00158"></a><span class="lineno"> 158</span>&#160; </div>
<div class="line"><a name="l00159"></a><span class="lineno"> 159</span>&#160;};</div>
<div class="line"><a name="l00160"></a><span class="lineno"> 160</span>&#160; </div>
<div class="line"><a name="l00161"></a><span class="lineno"> 161</span>&#160; </div>
<div class="line"><a name="l00166"></a><span class="lineno"><a class="line" href="class_bounce.html"> 166</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bounce.html">Bounce</a> : <span class="keyword">public</span> <a class="code" href="class_debouncer.html">Debouncer</a></div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160;{</div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160; </div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; </div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno"> 182</span>&#160; <a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>();</div>
<div class="line"><a name="l00183"></a><span class="lineno"> 183</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"> 184</span>&#160; </div>
<div class="line"><a name="l00193"></a><span class="lineno"> 193</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(<span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, <span class="keywordtype">int</span> mode);</div>
<div class="line"><a name="l00194"></a><span class="lineno"> 194</span>&#160; </div>
<div class="line"><a name="l00198"></a><span class="lineno"> 198</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(<span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>);</div>
<div class="line"><a name="l00199"></a><span class="lineno"> 199</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>(uint8_t <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> interval_millis ) : <a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>() {</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; <a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>);</div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; <a class="code" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(interval_millis);</div>
<div class="line"><a name="l00203"></a><span class="lineno"> 203</span>&#160; }</div>
<div class="line"><a name="l00204"></a><span class="lineno"> 204</span>&#160; </div>
<div class="line"><a name="l00206"></a><span class="lineno"> 206</span>&#160; <span class="comment">// Deprecated //</span></div>
<div class="line"><a name="l00208"></a><span class="lineno"> 208</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00212"></a><span class="lineno"><a class="line" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0"> 212</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">risingEdge</a>() { <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a>(); }</div>
<div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f"> 216</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">fallingEdge</a>() { <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a>(); }</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160; </div>
<div class="line"><a name="l00124"></a><span class="lineno"> 124</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00130"></a><span class="lineno"><a class="line" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248"> 130</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>( )<span class="keyword"> const </span>{ <span class="keywordflow">return</span> getStateFlag(CHANGED_STATE); }</div>
<div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; </div>
<div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; </div>
<div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; </div>
<div class="line"><a name="l00134"></a><span class="lineno"> 134</span>&#160; </div>
<div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">currentDuration</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; </div>
<div class="line"><a name="l00145"></a><span class="lineno"> 145</span>&#160; </div>
<div class="line"><a name="l00153"></a><span class="lineno"> 153</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">previousDuration</a>() <span class="keyword">const</span>;</div>
<div class="line"><a name="l00154"></a><span class="lineno"> 154</span>&#160; </div>
<div class="line"><a name="l00163"></a><span class="lineno"> 163</span>&#160; [[deprecated]]</div>
<div class="line"><a name="l00164"></a><span class="lineno"><a class="line" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448"> 164</a></span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> <a class="code" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>() {</div>
<div class="line"><a name="l00165"></a><span class="lineno"> 165</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">currentDuration</a>();</div>
<div class="line"><a name="l00166"></a><span class="lineno"> 166</span>&#160; };</div>
<div class="line"><a name="l00167"></a><span class="lineno"> 167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno"> 168</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00169"></a><span class="lineno"> 169</span>&#160; <span class="keywordtype">void</span> begin();</div>
<div class="line"><a name="l00170"></a><span class="lineno"> 170</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> readCurrentState() =0;</div>
<div class="line"><a name="l00171"></a><span class="lineno"> 171</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> previous_millis;</div>
<div class="line"><a name="l00172"></a><span class="lineno"> 172</span>&#160; uint16_t interval_millis;</div>
<div class="line"><a name="l00173"></a><span class="lineno"> 173</span>&#160; uint8_t state;</div>
<div class="line"><a name="l00174"></a><span class="lineno"> 174</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> stateChangeLastTime;</div>
<div class="line"><a name="l00175"></a><span class="lineno"> 175</span>&#160; <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> durationOfPreviousState;</div>
<div class="line"><a name="l00176"></a><span class="lineno"> 176</span>&#160; </div>
<div class="line"><a name="l00177"></a><span class="lineno"> 177</span>&#160;};</div>
<div class="line"><a name="l00178"></a><span class="lineno"> 178</span>&#160; </div>
<div class="line"><a name="l00179"></a><span class="lineno"> 179</span>&#160; </div>
<div class="line"><a name="l00184"></a><span class="lineno"><a class="line" href="class_bounce.html"> 184</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bounce.html">Bounce</a> : <span class="keyword">public</span> <a class="code" href="class_debouncer.html">Debouncer</a></div>
<div class="line"><a name="l00185"></a><span class="lineno"> 185</span>&#160;{</div>
<div class="line"><a name="l00186"></a><span class="lineno"> 186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno"> 187</span>&#160; </div>
<div class="line"><a name="l00188"></a><span class="lineno"> 188</span>&#160;<span class="keyword">public</span>:</div>
<div class="line"><a name="l00189"></a><span class="lineno"> 189</span>&#160; </div>
<div class="line"><a name="l00200"></a><span class="lineno"> 200</span>&#160; <a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>();</div>
<div class="line"><a name="l00201"></a><span class="lineno"> 201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno"> 202</span>&#160; </div>
<div class="line"><a name="l00211"></a><span class="lineno"> 211</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(<span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, <span class="keywordtype">int</span> mode);</div>
<div class="line"><a name="l00212"></a><span class="lineno"> 212</span>&#160; </div>
<div class="line"><a name="l00216"></a><span class="lineno"> 216</span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(<span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>);</div>
<div class="line"><a name="l00217"></a><span class="lineno"> 217</span>&#160; </div>
<div class="line"><a name="l00218"></a><span class="lineno"> 218</span>&#160; <a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>(uint8_t <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> interval_millis ) : <a class="code" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a>() {</div>
<div class="line"><a name="l00219"></a><span class="lineno"> 219</span>&#160; <a class="code" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a>(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>);</div>
<div class="line"><a name="l00220"></a><span class="lineno"> 220</span>&#160; <a class="code" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(interval_millis);</div>
<div class="line"><a name="l00221"></a><span class="lineno"> 221</span>&#160; }</div>
<div class="line"><a name="l00222"></a><span class="lineno"> 222</span>&#160; </div>
<div class="line"><a name="l00223"></a><span class="lineno"> 223</span>&#160; </div>
<div class="line"><a name="l00224"></a><span class="lineno"> 224</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno"><a class="line" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a"> 225</a></span>&#160; uint8_t <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>;</div>
<div class="line"><a name="l00226"></a><span class="lineno"> 226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno"> 227</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> readCurrentState() { <span class="keywordflow">return</span> digitalRead(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>); }</div>
<div class="line"><a name="l00228"></a><span class="lineno"> 228</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> setPinMode(<span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, <span class="keywordtype">int</span> mode) {</div>
<div class="line"><a name="l00229"></a><span class="lineno"> 229</span>&#160;<span class="preprocessor">#if defined(ARDUINO_ARCH_STM32F1)</span></div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; pinMode(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, (WiringPinMode)mode);</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; pinMode(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, mode);</div>
<div class="line"><a name="l00233"></a><span class="lineno"> 233</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; }</div>
<div class="line"><a name="l00235"></a><span class="lineno"> 235</span>&#160; </div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno"> 237</span>&#160; </div>
<div class="line"><a name="l00238"></a><span class="lineno"> 238</span>&#160;};</div>
<div class="line"><a name="l00239"></a><span class="lineno"> 239</span>&#160; </div>
<div class="line"><a name="l00243"></a><span class="lineno"><a class="line" href="namespace_bounce2.html"> 243</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_bounce2.html">Bounce2</a> {</div>
<div class="line"><a name="l00244"></a><span class="lineno"> 244</span>&#160; <span class="comment">// code declarations</span></div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; </div>
<div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html"> 246</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bounce2_1_1_button.html">Button</a> : <span class="keyword">public</span> <a class="code" href="class_bounce.html">Bounce</a>{</div>
<div class="line"><a name="l00247"></a><span class="lineno"> 247</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00248"></a><span class="lineno"> 248</span>&#160; <span class="keywordtype">bool</span> stateForPressed = 1; <span class="comment">// </span></div>
<div class="line"><a name="l00249"></a><span class="lineno"> 249</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00260"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad"> 260</a></span>&#160; <a class="code" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Button</a>(){ }</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160; </div>
<div class="line"><a name="l00269"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e"> 269</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">setPressedState</a>(<span class="keywordtype">bool</span> state){</div>
<div class="line"><a name="l00270"></a><span class="lineno"> 270</span>&#160; stateForPressed = state;</div>
<div class="line"><a name="l00271"></a><span class="lineno"> 271</span>&#160; }</div>
<div class="line"><a name="l00272"></a><span class="lineno"> 272</span>&#160; </div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba"> 276</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">getPressedState</a>() {</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160; <span class="keywordflow">return</span> stateForPressed;</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; };</div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; </div>
<div class="line"><a name="l00283"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676"> 283</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">isPressed</a>() {</div>
<div class="line"><a name="l00284"></a><span class="lineno"> 284</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a>() == <a class="code" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">getPressedState</a>();</div>
<div class="line"><a name="l00285"></a><span class="lineno"> 285</span>&#160; };</div>
<div class="line"><a name="l00286"></a><span class="lineno"> 286</span>&#160; </div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad"> 290</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">pressed</a>() {</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>() &amp;&amp; <a class="code" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">isPressed</a>();</div>
<div class="line"><a name="l00292"></a><span class="lineno"> 292</span>&#160; };</div>
<div class="line"><a name="l00293"></a><span class="lineno"> 293</span>&#160; </div>
<div class="line"><a name="l00297"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37"> 297</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37">released</a>() {</div>
<div class="line"><a name="l00298"></a><span class="lineno"> 298</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>() &amp;&amp; !<a class="code" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">isPressed</a>();</div>
<div class="line"><a name="l00299"></a><span class="lineno"> 299</span>&#160; };</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; </div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160;};</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160;};</div>
<div class="line"><a name="l00303"></a><span class="lineno"> 303</span>&#160; </div>
<div class="line"><a name="l00304"></a><span class="lineno"> 304</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00229"></a><span class="lineno"><a class="line" href="class_bounce.html#a114878745aa1f29d3c0c293538280646"> 229</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">getPin</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00230"></a><span class="lineno"> 230</span>&#160; <span class="keywordflow">return</span> this-&gt;<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>;</div>
<div class="line"><a name="l00231"></a><span class="lineno"> 231</span>&#160; };</div>
<div class="line"><a name="l00232"></a><span class="lineno"> 232</span>&#160; </div>
<div class="line"><a name="l00234"></a><span class="lineno"> 234</span>&#160; <span class="comment">// Deprecated //</span></div>
<div class="line"><a name="l00236"></a><span class="lineno"> 236</span>&#160;<span class="comment"></span> </div>
<div class="line"><a name="l00240"></a><span class="lineno"> 240</span>&#160; [[deprecated]]</div>
<div class="line"><a name="l00241"></a><span class="lineno"><a class="line" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2"> 241</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">risingEdge</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a>(); }</div>
<div class="line"><a name="l00245"></a><span class="lineno"> 245</span>&#160; [[deprecated]]</div>
<div class="line"><a name="l00246"></a><span class="lineno"><a class="line" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f"> 246</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">fallingEdge</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a>(); }</div>
<div class="line"><a name="l00252"></a><span class="lineno"> 252</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00253"></a><span class="lineno"> 253</span>&#160; </div>
<div class="line"><a name="l00254"></a><span class="lineno"> 254</span>&#160; </div>
<div class="line"><a name="l00255"></a><span class="lineno"><a class="line" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a"> 255</a></span>&#160; uint8_t <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>;</div>
<div class="line"><a name="l00256"></a><span class="lineno"> 256</span>&#160; </div>
<div class="line"><a name="l00257"></a><span class="lineno"> 257</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">bool</span> readCurrentState() { <span class="keywordflow">return</span> digitalRead(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>); }</div>
<div class="line"><a name="l00258"></a><span class="lineno"> 258</span>&#160; <span class="keyword">virtual</span> <span class="keywordtype">void</span> setPinMode(<span class="keywordtype">int</span> <a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, <span class="keywordtype">int</span> mode) {</div>
<div class="line"><a name="l00259"></a><span class="lineno"> 259</span>&#160;<span class="preprocessor">#if defined(ARDUINO_ARCH_STM32F1)</span></div>
<div class="line"><a name="l00260"></a><span class="lineno"> 260</span>&#160; pinMode(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, (WiringPinMode)mode);</div>
<div class="line"><a name="l00261"></a><span class="lineno"> 261</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00262"></a><span class="lineno"> 262</span>&#160; pinMode(<a class="code" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, mode);</div>
<div class="line"><a name="l00263"></a><span class="lineno"> 263</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00264"></a><span class="lineno"> 264</span>&#160; }</div>
<div class="line"><a name="l00265"></a><span class="lineno"> 265</span>&#160; </div>
<div class="line"><a name="l00266"></a><span class="lineno"> 266</span>&#160; </div>
<div class="line"><a name="l00267"></a><span class="lineno"> 267</span>&#160; </div>
<div class="line"><a name="l00268"></a><span class="lineno"> 268</span>&#160;};</div>
<div class="line"><a name="l00269"></a><span class="lineno"> 269</span>&#160; </div>
<div class="line"><a name="l00273"></a><span class="lineno"><a class="line" href="namespace_bounce2.html"> 273</a></span>&#160;<span class="keyword">namespace </span><a class="code" href="namespace_bounce2.html">Bounce2</a> {</div>
<div class="line"><a name="l00274"></a><span class="lineno"> 274</span>&#160; <span class="comment">// code declarations</span></div>
<div class="line"><a name="l00275"></a><span class="lineno"> 275</span>&#160; </div>
<div class="line"><a name="l00276"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html"> 276</a></span>&#160;<span class="keyword">class </span><a class="code" href="class_bounce2_1_1_button.html">Button</a> : <span class="keyword">public</span> <a class="code" href="class_bounce.html">Bounce</a>{</div>
<div class="line"><a name="l00277"></a><span class="lineno"> 277</span>&#160;<span class="keyword">protected</span>:</div>
<div class="line"><a name="l00278"></a><span class="lineno"> 278</span>&#160; <span class="keywordtype">bool</span> stateForPressed = 1; <span class="comment">// </span></div>
<div class="line"><a name="l00279"></a><span class="lineno"> 279</span>&#160; <span class="keyword">public</span>:</div>
<div class="line"><a name="l00290"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad"> 290</a></span>&#160; <a class="code" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Button</a>(){ }</div>
<div class="line"><a name="l00291"></a><span class="lineno"> 291</span>&#160; </div>
<div class="line"><a name="l00299"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e"> 299</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">setPressedState</a>(<span class="keywordtype">bool</span> state){</div>
<div class="line"><a name="l00300"></a><span class="lineno"> 300</span>&#160; stateForPressed = state;</div>
<div class="line"><a name="l00301"></a><span class="lineno"> 301</span>&#160; }</div>
<div class="line"><a name="l00302"></a><span class="lineno"> 302</span>&#160; </div>
<div class="line"><a name="l00306"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c"> 306</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">getPressedState</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00307"></a><span class="lineno"> 307</span>&#160; <span class="keywordflow">return</span> stateForPressed;</div>
<div class="line"><a name="l00308"></a><span class="lineno"> 308</span>&#160; };</div>
<div class="line"><a name="l00309"></a><span class="lineno"> 309</span>&#160; </div>
<div class="line"><a name="l00313"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f"> 313</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">isPressed</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00314"></a><span class="lineno"> 314</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a>() == <a class="code" href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">getPressedState</a>();</div>
<div class="line"><a name="l00315"></a><span class="lineno"> 315</span>&#160; };</div>
<div class="line"><a name="l00316"></a><span class="lineno"> 316</span>&#160; </div>
<div class="line"><a name="l00320"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd"> 320</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">pressed</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00321"></a><span class="lineno"> 321</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>() &amp;&amp; <a class="code" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">isPressed</a>();</div>
<div class="line"><a name="l00322"></a><span class="lineno"> 322</span>&#160; };</div>
<div class="line"><a name="l00323"></a><span class="lineno"> 323</span>&#160; </div>
<div class="line"><a name="l00327"></a><span class="lineno"><a class="line" href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad"> 327</a></span>&#160; <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">released</a>()<span class="keyword"> const </span>{</div>
<div class="line"><a name="l00328"></a><span class="lineno"> 328</span>&#160; <span class="keywordflow">return</span> <a class="code" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>() &amp;&amp; !<a class="code" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">isPressed</a>();</div>
<div class="line"><a name="l00329"></a><span class="lineno"> 329</span>&#160; };</div>
<div class="line"><a name="l00330"></a><span class="lineno"> 330</span>&#160; </div>
<div class="line"><a name="l00331"></a><span class="lineno"> 331</span>&#160;};</div>
<div class="line"><a name="l00332"></a><span class="lineno"> 332</span>&#160;};</div>
<div class="line"><a name="l00333"></a><span class="lineno"> 333</span>&#160; </div>
<div class="line"><a name="l00334"></a><span class="lineno"> 334</span>&#160;<span class="preprocessor">#endif</span></div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="aclass_bounce2_1_1_button_html"><div class="ttname"><a href="class_bounce2_1_1_button.html">Bounce2::Button</a></div><div class="ttdef"><b>Definition:</b> Bounce2.h:246</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_ab9e2b89ad499fa4b052370140730b6ba"><div class="ttname"><a href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">Bounce2::Button::getPressedState</a></div><div class="ttdeci">bool getPressedState()</div><div class="ttdoc">Get the electrical state (HIGH/LOW) that corresponds to a physical press.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:276</div></div>
<div class="ttc" id="aclass_debouncer_html_a1ef5a04b4ebe97352ff3bb227476035c"><div class="ttname"><a href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">Debouncer::fell</a></div><div class="ttdeci">bool fell()</div><div class="ttdoc">Returns true if pin signal transitions from high to low.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:128</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html"><div class="ttname"><a href="class_bounce2_1_1_button.html">Bounce2::Button</a></div><div class="ttdef"><b>Definition:</b> Bounce2.h:276</div></div>
<div class="ttc" id="aclass_debouncer_html_a930bf3945e698d77b889f6309079857d"><div class="ttname"><a href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">Debouncer::interval</a></div><div class="ttdeci">void interval(uint16_t interval_millis)</div><div class="ttdoc">Sets the debounce interval in milliseconds.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:14</div></div>
<div class="ttc" id="aclass_debouncer_html_a2cae68910c19c778507f257842fc41bf"><div class="ttname"><a href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">Debouncer::read</a></div><div class="ttdeci">bool read()</div><div class="ttdoc">Returns the pin's state (HIGH or LOW).</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:118</div></div>
<div class="ttc" id="aclass_debouncer_html_ac6af22dc9c6ae84462fe356b7430659e"><div class="ttname"><a href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">Debouncer::previousDuration</a></div><div class="ttdeci">unsigned long previousDuration() const</div><div class="ttdoc">Returns the duration in milliseconds of the previous state.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:103</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a1f90c647e0c75d243cdafed16c6eb28c"><div class="ttname"><a href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">Bounce2::Button::getPressedState</a></div><div class="ttdeci">bool getPressedState() const</div><div class="ttdoc">Get the electrical state (HIGH/LOW) that corresponds to a physical press.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:306</div></div>
<div class="ttc" id="aclass_bounce_html_aa62a2e2b5ad0ee6913a95f2f2a0e7606"><div class="ttname"><a href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce::Bounce</a></div><div class="ttdeci">Bounce()</div><div class="ttdoc">Create an instance of the Bounce class.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:138</div></div>
<div class="ttc" id="aclass_debouncer_html_a47c83f13a03920d21fbfafd8469ec06b"><div class="ttname"><a href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">Debouncer::changed</a></div><div class="ttdeci">bool changed()</div><div class="ttdoc">Returns true if the state changed on last update.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:129</div></div>
<div class="ttc" id="aclass_debouncer_html_a462994f1f9a20876b2ee239eeee97448"><div class="ttname"><a href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">Debouncer::duration</a></div><div class="ttdeci">unsigned long duration()</div><div class="ttdoc">Returns the duration in milliseconds of the current state.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:107</div></div>
<div class="ttc" id="aclass_debouncer_html_a9990de6fa7256842c35c246d7dea8dbb"><div class="ttname"><a href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">Debouncer::rose</a></div><div class="ttdeci">bool rose()</div><div class="ttdoc">Returns true if pin signal transitions from low to high.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:123</div></div>
<div class="ttc" id="aclass_bounce_html_a1cb79cb0ba2379cd12cc7c098d97053a"><div class="ttname"><a href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">Bounce::pin</a></div><div class="ttdeci">uint8_t pin</div><div class="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:225</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a902d9df3cd993f80f59bcb205ed4be37"><div class="ttname"><a href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37">Bounce2::Button::released</a></div><div class="ttdeci">bool released()</div><div class="ttdoc">Returns true if the button was physically released</div><div class="ttdef"><b>Definition:</b> Bounce2.h:297</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a94c31de8109c89d6ee577ed9b14ea676"><div class="ttname"><a href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">Bounce2::Button::isPressed</a></div><div class="ttdeci">bool isPressed()</div><div class="ttdoc">Returns true if the button is currently physically pressed.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:283</div></div>
<div class="ttc" id="aclass_bounce_html_a3417beb80eb6593d768c2e9884c57aa0"><div class="ttname"><a href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">Bounce::risingEdge</a></div><div class="ttdeci">bool risingEdge()</div><div class="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:212</div></div>
<div class="ttc" id="aclass_debouncer_html_a462994f1f9a20876b2ee239eeee97448"><div class="ttname"><a href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">Debouncer::duration</a></div><div class="ttdeci">unsigned long duration()</div><div class="ttdoc">DEPRECATED (i.e. do not use). Renamed currentDuration().</div><div class="ttdef"><b>Definition:</b> Bounce2.h:164</div></div>
<div class="ttc" id="aclass_bounce_html_a3ef5b85db62a7a7807f0050c86cc735f"><div class="ttname"><a href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">Bounce::fallingEdge</a></div><div class="ttdeci">bool fallingEdge() const</div><div class="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:246</div></div>
<div class="ttc" id="aclass_debouncer_html_ab61244e043754ebdc7a156da1e1824bf"><div class="ttname"><a href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">Debouncer::rose</a></div><div class="ttdeci">bool rose() const</div><div class="ttdoc">Returns true if pin signal transitions from low to high.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:123</div></div>
<div class="ttc" id="aclass_bounce_html_a1cb79cb0ba2379cd12cc7c098d97053a"><div class="ttname"><a href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">Bounce::pin</a></div><div class="ttdeci">uint8_t pin</div><div class="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:255</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a61541ae21354cb7f5cc5bc8c05db59dd"><div class="ttname"><a href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">Bounce2::Button::pressed</a></div><div class="ttdeci">bool pressed() const</div><div class="ttdoc">Returns true if the button was physically pressed</div><div class="ttdef"><b>Definition:</b> Bounce2.h:320</div></div>
<div class="ttc" id="aclass_debouncer_html_a883645ca26b4df6e5823586432104d11"><div class="ttname"><a href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">Debouncer::currentDuration</a></div><div class="ttdeci">unsigned long currentDuration() const</div><div class="ttdoc">Returns the duration in milliseconds of the current state.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:107</div></div>
<div class="ttc" id="aclass_debouncer_html_a72f3e8d483555031d2ac21b0b7702c06"><div class="ttname"><a href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">Debouncer::update</a></div><div class="ttdeci">bool update()</div><div class="ttdoc">Updates the pin's state.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:32</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a18710b645862d2b8f058a73aabbaf7ad"><div class="ttname"><a href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button::Button</a></div><div class="ttdeci">Button()</div><div class="ttdoc">Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:260</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a3fbacfb9a631e03afcfaa5dc39686bad"><div class="ttname"><a href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">Bounce2::Button::pressed</a></div><div class="ttdeci">bool pressed()</div><div class="ttdoc">Returns true if the button was physically pressed</div><div class="ttdef"><b>Definition:</b> Bounce2.h:290</div></div>
<div class="ttc" id="aclass_debouncer_html_a89ab95e7ac24874bb8cb684dc36a98b9"><div class="ttname"><a href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">Debouncer::previousDuration</a></div><div class="ttdeci">unsigned long previousDuration()</div><div class="ttdoc">Returns the duration in milliseconds of the previous state.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:103</div></div>
<div class="ttc" id="aclass_bounce_html"><div class="ttname"><a href="class_bounce.html">Bounce</a></div><div class="ttdoc">The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:166</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a18710b645862d2b8f058a73aabbaf7ad"><div class="ttname"><a href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button::Button</a></div><div class="ttdeci">Button()</div><div class="ttdoc">Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:290</div></div>
<div class="ttc" id="aclass_bounce_html"><div class="ttname"><a href="class_bounce.html">Bounce</a></div><div class="ttdoc">The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:184</div></div>
<div class="ttc" id="aclass_bounce_html_a114878745aa1f29d3c0c293538280646"><div class="ttname"><a href="class_bounce.html#a114878745aa1f29d3c0c293538280646">Bounce::getPin</a></div><div class="ttdeci">int getPin() const</div><div class="ttdoc">Return pin that this Bounce is attached to.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:229</div></div>
<div class="ttc" id="aclass_debouncer_html"><div class="ttname"><a href="class_debouncer.html">Debouncer</a></div><div class="ttdoc">The Debouce class. Just the deboucing code separated from all harware.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:62</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a3c88b7938b26bca9dc2c7e72aedc442e"><div class="ttname"><a href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button::setPressedState</a></div><div class="ttdeci">void setPressedState(bool state)</div><div class="ttdoc">Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default,...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:269</div></div>
<div class="ttc" id="aclass_bounce_html_ac756559419bfa1c5060e5e4a4ad6406f"><div class="ttname"><a href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">Bounce::fallingEdge</a></div><div class="ttdeci">bool fallingEdge()</div><div class="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:216</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a3c88b7938b26bca9dc2c7e72aedc442e"><div class="ttname"><a href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button::setPressedState</a></div><div class="ttdeci">void setPressedState(bool state)</div><div class="ttdoc">Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default,...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:299</div></div>
<div class="ttc" id="aclass_debouncer_html_a80315de311b855f9787b4b6d5b7899e0"><div class="ttname"><a href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">Debouncer::fell</a></div><div class="ttdeci">bool fell() const</div><div class="ttdoc">Returns true if pin signal transitions from high to low.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:128</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_ae9bc1365cf132e57feda6dff112edbad"><div class="ttname"><a href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">Bounce2::Button::released</a></div><div class="ttdeci">bool released() const</div><div class="ttdoc">Returns true if the button was physically released</div><div class="ttdef"><b>Definition:</b> Bounce2.h:327</div></div>
<div class="ttc" id="aclass_bounce_html_aba08e592941465d033e3eba3dde66eaf"><div class="ttname"><a href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">Bounce::attach</a></div><div class="ttdeci">void attach(int pin, int mode)</div><div class="ttdoc">Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT).</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:149</div></div>
<div class="ttc" id="anamespace_bounce2_html"><div class="ttname"><a href="namespace_bounce2.html">Bounce2</a></div><div class="ttdoc">The Debouncer:Bounce:Button class. The Button class matches an electrical state to a physical action.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:243</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a73c7c9ef574afe8bf1a9f3eb492bfa7f"><div class="ttname"><a href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">Bounce2::Button::isPressed</a></div><div class="ttdeci">bool isPressed() const</div><div class="ttdoc">Returns true if the button is currently physically pressed.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:313</div></div>
<div class="ttc" id="aclass_debouncer_html_aa5fcde9156f700c362fd49af5dd92ecd"><div class="ttname"><a href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">Debouncer::read</a></div><div class="ttdeci">bool read() const</div><div class="ttdoc">Returns the pin's state (HIGH or LOW).</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:118</div></div>
<div class="ttc" id="aclass_bounce_html_adff02eed264355c2bf90d131768f84c2"><div class="ttname"><a href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">Bounce::risingEdge</a></div><div class="ttdeci">bool risingEdge() const</div><div class="ttdoc">Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce ver...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:241</div></div>
<div class="ttc" id="aclass_debouncer_html_a1bbd627f9d8809b5ee9e64e9fb21e248"><div class="ttname"><a href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">Debouncer::changed</a></div><div class="ttdeci">bool changed() const</div><div class="ttdoc">Returns true if the state changed on last update.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:130</div></div>
<div class="ttc" id="anamespace_bounce2_html"><div class="ttname"><a href="namespace_bounce2.html">Bounce2</a></div><div class="ttdoc">The Debouncer:Bounce:Button class. The Button class matches an electrical state to a physical action.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:273</div></div>
<div class="ttc" id="aclass_debouncer_html_a34c46ca04d4178933cc0049436d10fe6"><div class="ttname"><a href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer::Debouncer</a></div><div class="ttdeci">Debouncer()</div><div class="ttdoc">Create an instance of the Debounce class.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:10</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

@ -69,7 +69,7 @@ $(function() {
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">N</span></span><a class="el" href="namespace_bounce2.html" target="_self">Bounce2</a></td><td class="desc">The Debouncer:Bounce:<a class="el" href="class_bounce2_1_1_button.html">Button</a> class. The <a class="el" href="class_bounce2_1_1_button.html">Button</a> class matches an electrical state to a physical action </td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_bounce2_1_1_button.html" target="_self">Button</a></td><td class="desc"></td></tr>
<tr id="row_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_bounce.html" target="_self">Bounce</a></td><td class="desc">The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. Links the Deboucing class to a hardware pin </td></tr>
<tr id="row_1_" class="even"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_bounce.html" target="_self">Bounce</a></td><td class="desc">The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<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> class. Links the Deboucing class to a hardware pin. This class is odly named, but it will be kept that so it stays compatible with previous code </td></tr>
<tr id="row_2_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_debouncer.html" target="_self">Debouncer</a></td><td class="desc">The Debouce class. Just the deboucing code separated from all harware </td></tr>
</table>
</div><!-- directory -->

@ -65,7 +65,7 @@ $(function() {
<div class="title">bounce_basic.ino</div> </div>
</div><!--header-->
<div class="contents">
<p>Basic example of the <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class.</p>
<p>Basic example of the <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> class.</p>
<div class="fragment"><div class="line"> </div>
<div class="line">/*</div>
<div class="line"> DESCRIPTION</div>
@ -104,9 +104,9 @@ $(function() {
<div class="line"> </div>
<div class="line"> // SELECT ONE OF THE FOLLOWING :</div>
<div class="line"> // 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP</div>
<div class="line"> // bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP</div>
<div class="line"> bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP</div>
<div class="line"> // 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP</div>
<div class="line"> bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP</div>
<div class="line"> //bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP</div>
<div class="line"> </div>
<div class="line"> // DEBOUNCE INTERVAL IN MILLISECONDS</div>
<div class="line"> bounce.interval(5); // interval in ms</div>

@ -73,21 +73,23 @@ $(function() {
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>begin</b>() (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><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 bgcolor="#f0f0f0" class="even"><td class="entry"><b>Bounce</b>(uint8_t pin, unsigned long interval_millis) (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></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>durationOfPreviousState</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></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_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">currentDuration</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>durationOfPreviousState</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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#a3ef5b85db62a7a7807f0050c86cc735f">fallingEdge</a>() const</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><td class="entry"><a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">getPin</a>() const</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><td class="entry"><a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(uint16_t interval_millis)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</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_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">previousDuration</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><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 class="even"><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><td class="entry"><a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">risingEdge</a>() const</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><td class="entry"><a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><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"><td class="entry"><b>state</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>stateChangeLastTime</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>

@ -71,7 +71,7 @@ $(function() {
</div><!--header-->
<div class="contents">
<p>The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. Links the Deboucing class to a hardware pin.
<p>The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<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> class. Links the Deboucing class to a hardware pin. This class is odly named, but it will be kept that so it stays compatible with previous code.
<a href="class_bounce.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a>&gt;</code></p>
@ -89,7 +89,7 @@ Inheritance diagram for Bounce:</div>
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a> ()</td></tr>
<tr class="memdesc:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an instance of the <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. <a href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">More...</a><br /></td></tr>
<tr class="memdesc:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an instance of the <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> class. <a href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">More...</a><br /></td></tr>
<tr class="separator:aa62a2e2b5ad0ee6913a95f2f2a0e7606"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba08e592941465d033e3eba3dde66eaf"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a> (int <a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, int mode)</td></tr>
<tr class="memdesc:aba08e592941465d033e3eba3dde66eaf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT). <a href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">More...</a><br /></td></tr>
@ -99,14 +99,17 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:ab34517094faf21d4f38b36da2915132b"><td class="memItemLeft" align="right" valign="top"><a id="ab34517094faf21d4f38b36da2915132b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Bounce</b> (uint8_t <a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, unsigned long interval_millis)</td></tr>
<tr class="separator:ab34517094faf21d4f38b36da2915132b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3417beb80eb6593d768c2e9884c57aa0"><td class="memItemLeft" align="right" valign="top"><a id="a3417beb80eb6593d768c2e9884c57aa0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">risingEdge</a> ()</td></tr>
<tr class="memdesc:a3417beb80eb6593d768c2e9884c57aa0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a3417beb80eb6593d768c2e9884c57aa0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac756559419bfa1c5060e5e4a4ad6406f"><td class="memItemLeft" align="right" valign="top"><a id="ac756559419bfa1c5060e5e4a4ad6406f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">fallingEdge</a> ()</td></tr>
<tr class="memdesc:ac756559419bfa1c5060e5e4a4ad6406f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:ac756559419bfa1c5060e5e4a4ad6406f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a114878745aa1f29d3c0c293538280646"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">getPin</a> () const</td></tr>
<tr class="memdesc:a114878745aa1f29d3c0c293538280646"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return pin that this <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> is attached to. <a href="class_bounce.html#a114878745aa1f29d3c0c293538280646">More...</a><br /></td></tr>
<tr class="separator:a114878745aa1f29d3c0c293538280646"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adff02eed264355c2bf90d131768f84c2"><td class="memItemLeft" align="right" valign="top"><a id="adff02eed264355c2bf90d131768f84c2"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">risingEdge</a> () const</td></tr>
<tr class="memdesc:adff02eed264355c2bf90d131768f84c2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:adff02eed264355c2bf90d131768f84c2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ef5b85db62a7a7807f0050c86cc735f"><td class="memItemLeft" align="right" valign="top"><a id="a3ef5b85db62a7a7807f0050c86cc735f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">fallingEdge</a> () const</td></tr>
<tr class="memdesc:a3ef5b85db62a7a7807f0050c86cc735f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a3ef5b85db62a7a7807f0050c86cc735f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_debouncer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_debouncer')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_debouncer.html">Debouncer</a></td></tr>
<tr class="memitem:a34c46ca04d4178933cc0049436d10fe6 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a34c46ca04d4178933cc0049436d10fe6 inherit pub_methods_class_debouncer"><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>
@ -117,26 +120,29 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
<tr class="memitem:a72f3e8d483555031d2ac21b0b7702c06 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a72f3e8d483555031d2ac21b0b7702c06 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the pin's state. <a href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">More...</a><br /></td></tr>
<tr class="separator:a72f3e8d483555031d2ac21b0b7702c06 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cae68910c19c778507f257842fc41bf inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a> ()</td></tr>
<tr class="memdesc:a2cae68910c19c778507f257842fc41bf inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin's state (HIGH or LOW). <a href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">More...</a><br /></td></tr>
<tr class="separator:a2cae68910c19c778507f257842fc41bf inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ef5a04b4ebe97352ff3bb227476035c inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="a1ef5a04b4ebe97352ff3bb227476035c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a> ()</td></tr>
<tr class="memdesc:a1ef5a04b4ebe97352ff3bb227476035c inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
<tr class="separator:a1ef5a04b4ebe97352ff3bb227476035c inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9990de6fa7256842c35c246d7dea8dbb inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="a9990de6fa7256842c35c246d7dea8dbb"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a> ()</td></tr>
<tr class="memdesc:a9990de6fa7256842c35c246d7dea8dbb inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
<tr class="separator:a9990de6fa7256842c35c246d7dea8dbb inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47c83f13a03920d21fbfafd8469ec06b inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a> ()</td></tr>
<tr class="memdesc:a47c83f13a03920d21fbfafd8469ec06b inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the state changed on last update. <a href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">More...</a><br /></td></tr>
<tr class="separator:a47c83f13a03920d21fbfafd8469ec06b inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5fcde9156f700c362fd49af5dd92ecd inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:aa5fcde9156f700c362fd49af5dd92ecd inherit pub_methods_class_debouncer"><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>
<tr class="separator:aa5fcde9156f700c362fd49af5dd92ecd inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80315de311b855f9787b4b6d5b7899e0 inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="a80315de311b855f9787b4b6d5b7899e0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a> () const</td></tr>
<tr class="memdesc:a80315de311b855f9787b4b6d5b7899e0 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
<tr class="separator:a80315de311b855f9787b4b6d5b7899e0 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab61244e043754ebdc7a156da1e1824bf inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="ab61244e043754ebdc7a156da1e1824bf"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a> () const</td></tr>
<tr class="memdesc:ab61244e043754ebdc7a156da1e1824bf inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
<tr class="separator:ab61244e043754ebdc7a156da1e1824bf inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bbd627f9d8809b5ee9e64e9fb21e248 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a1bbd627f9d8809b5ee9e64e9fb21e248 inherit pub_methods_class_debouncer"><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>
<tr class="separator:a1bbd627f9d8809b5ee9e64e9fb21e248 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a883645ca26b4df6e5823586432104d11 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a883645ca26b4df6e5823586432104d11 inherit pub_methods_class_debouncer"><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>
<tr class="separator:a883645ca26b4df6e5823586432104d11 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6af22dc9c6ae84462fe356b7430659e inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:ac6af22dc9c6ae84462fe356b7430659e inherit pub_methods_class_debouncer"><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>
<tr class="separator:ac6af22dc9c6ae84462fe356b7430659e inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the current state. <a href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">More...</a><br /></td></tr>
<tr class="memdesc:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><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>
<tr class="separator:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89ab95e7ac24874bb8cb684dc36a98b9 inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a> ()</td></tr>
<tr class="memdesc:a89ab95e7ac24874bb8cb684dc36a98b9 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the previous state. <a href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">More...</a><br /></td></tr>
<tr class="separator:a89ab95e7ac24874bb8cb684dc36a98b9 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
@ -155,7 +161,7 @@ void&#160;</td><td class="memItemRight" valign="bottom"><b>begin</b> ()</td></tr
Protected Attributes</h2></td></tr>
<tr class="memitem:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="memItemLeft" align="right" valign="top"><a id="a1cb79cb0ba2379cd12cc7c098d97053a"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a></td></tr>
<tr class="memdesc:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> version 1. <br /></td></tr>
<tr class="memdesc:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a1cb79cb0ba2379cd12cc7c098d97053a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_class_debouncer"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_debouncer')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="class_debouncer.html">Debouncer</a></td></tr>
<tr class="memitem:afab369aec42a15595ebac695a088cccd inherit pro_attribs_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="afab369aec42a15595ebac695a088cccd"></a>
@ -175,7 +181,7 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<tr class="separator:adbe8de6a1cfff329629e9136a4efea6c inherit pro_attribs_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. Links the Deboucing class to a hardware pin. </p>
<div class="textblock"><p>The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<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> class. Links the Deboucing class to a hardware pin. This class is odly named, but it will be kept that so it stays compatible with previous code. </p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="aa62a2e2b5ad0ee6913a95f2f2a0e7606"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa62a2e2b5ad0ee6913a95f2f2a0e7606">&#9670;&nbsp;</a></span>Bounce()</h2>
@ -192,7 +198,7 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
</table>
</div><div class="memdoc">
<p>Create an instance of the <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. </p>
<p>Create an instance of the <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> 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 -->
@ -253,6 +259,34 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
</dd>
</dl>
</div>
</div>
<a id="a114878745aa1f29d3c0c293538280646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a114878745aa1f29d3c0c293538280646">&#9670;&nbsp;</a></span>getPin()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">int Bounce::getPin </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Return pin that this <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> is attached to. </p>
<dl class="section return"><dt>Returns</dt><dd>integer identifier of the coupled pin </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>

@ -78,25 +78,27 @@ $(function() {
<tr><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 bgcolor="#f0f0f0" class="even"><td class="entry"><b>Bounce</b>(uint8_t pin, unsigned long interval_millis) (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></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Button</a>()</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>durationOfPreviousState</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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#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><td class="entry"><a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">getPressedState</a>()</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">currentDuration</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>durationOfPreviousState</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">fallingEdge</a>() const</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_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">getPin</a>() const</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_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">getPressedState</a>() const</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(uint16_t interval_millis)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">isPressed</a>()</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">isPressed</a>() const</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</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#a1cb79cb0ba2379cd12cc7c098d97053a">pin</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_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">pressed</a>()</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">pressed</a>() const</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>previous_millis</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">previousDuration</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><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 class="even"><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37">released</a>()</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</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_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">released</a>() const</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr><td class="entry"><a class="el" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">risingEdge</a>() const</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_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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 class="even"><td class="entry"><a class="el" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">setPressedState</a>(bool state)</td><td class="entry"><a class="el" href="class_bounce2_1_1_button.html">Bounce2::Button</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>state</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>

@ -79,7 +79,7 @@ Inheritance diagram for Bounce2::Button:</div>
<div class="center">
<img src="class_bounce2_1_1_button.png" usemap="#Bounce2::Button_map" alt=""/>
<map id="Bounce2::Button_map" name="Bounce2::Button_map">
<area href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin." alt="Bounce" shape="rect" coords="0,56,103,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"/>
<area href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware." alt="Debouncer" shape="rect" coords="0,0,103,24"/>
</map>
</div></div>
@ -92,27 +92,27 @@ Public Member Functions</h2></td></tr>
<tr class="memitem:a3c88b7938b26bca9dc2c7e72aedc442e"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">setPressedState</a> (bool state)</td></tr>
<tr class="memdesc:a3c88b7938b26bca9dc2c7e72aedc442e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default, the pressed state is matched to a HIGH electrical level. <a href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">More...</a><br /></td></tr>
<tr class="separator:a3c88b7938b26bca9dc2c7e72aedc442e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab9e2b89ad499fa4b052370140730b6ba"><td class="memItemLeft" align="right" valign="top"><a id="ab9e2b89ad499fa4b052370140730b6ba"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">getPressedState</a> ()</td></tr>
<tr class="memdesc:ab9e2b89ad499fa4b052370140730b6ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the electrical state (HIGH/LOW) that corresponds to a physical press. <br /></td></tr>
<tr class="separator:ab9e2b89ad499fa4b052370140730b6ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94c31de8109c89d6ee577ed9b14ea676"><td class="memItemLeft" align="right" valign="top"><a id="a94c31de8109c89d6ee577ed9b14ea676"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">isPressed</a> ()</td></tr>
<tr class="memdesc:a94c31de8109c89d6ee577ed9b14ea676"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the button is currently physically pressed. <br /></td></tr>
<tr class="separator:a94c31de8109c89d6ee577ed9b14ea676"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3fbacfb9a631e03afcfaa5dc39686bad"><td class="memItemLeft" align="right" valign="top"><a id="a3fbacfb9a631e03afcfaa5dc39686bad"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">pressed</a> ()</td></tr>
<tr class="memdesc:a3fbacfb9a631e03afcfaa5dc39686bad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the button was physically pressed <br />
<tr class="memitem:a1f90c647e0c75d243cdafed16c6eb28c"><td class="memItemLeft" align="right" valign="top"><a id="a1f90c647e0c75d243cdafed16c6eb28c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">getPressedState</a> () const</td></tr>
<tr class="memdesc:a1f90c647e0c75d243cdafed16c6eb28c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the electrical state (HIGH/LOW) that corresponds to a physical press. <br /></td></tr>
<tr class="separator:a1f90c647e0c75d243cdafed16c6eb28c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a73c7c9ef574afe8bf1a9f3eb492bfa7f"><td class="memItemLeft" align="right" valign="top"><a id="a73c7c9ef574afe8bf1a9f3eb492bfa7f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">isPressed</a> () const</td></tr>
<tr class="memdesc:a73c7c9ef574afe8bf1a9f3eb492bfa7f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the button is currently physically pressed. <br /></td></tr>
<tr class="separator:a73c7c9ef574afe8bf1a9f3eb492bfa7f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61541ae21354cb7f5cc5bc8c05db59dd"><td class="memItemLeft" align="right" valign="top"><a id="a61541ae21354cb7f5cc5bc8c05db59dd"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">pressed</a> () const</td></tr>
<tr class="memdesc:a61541ae21354cb7f5cc5bc8c05db59dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the button was physically pressed <br />
<br /></td></tr>
<tr class="separator:a3fbacfb9a631e03afcfaa5dc39686bad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a902d9df3cd993f80f59bcb205ed4be37"><td class="memItemLeft" align="right" valign="top"><a id="a902d9df3cd993f80f59bcb205ed4be37"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37">released</a> ()</td></tr>
<tr class="memdesc:a902d9df3cd993f80f59bcb205ed4be37"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the button was physically released <br />
<tr class="separator:a61541ae21354cb7f5cc5bc8c05db59dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae9bc1365cf132e57feda6dff112edbad"><td class="memItemLeft" align="right" valign="top"><a id="ae9bc1365cf132e57feda6dff112edbad"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">released</a> () const</td></tr>
<tr class="memdesc:ae9bc1365cf132e57feda6dff112edbad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the button was physically released <br />
<br /></td></tr>
<tr class="separator:a902d9df3cd993f80f59bcb205ed4be37"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="separator:ae9bc1365cf132e57feda6dff112edbad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_bounce"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_bounce')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_bounce.html">Bounce</a></td></tr>
<tr class="memitem:aa62a2e2b5ad0ee6913a95f2f2a0e7606 inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">Bounce</a> ()</td></tr>
<tr class="memdesc:aa62a2e2b5ad0ee6913a95f2f2a0e7606 inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an instance of the <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. <a href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">More...</a><br /></td></tr>
<tr class="memdesc:aa62a2e2b5ad0ee6913a95f2f2a0e7606 inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create an instance of the <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> class. <a href="class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606">More...</a><br /></td></tr>
<tr class="separator:aa62a2e2b5ad0ee6913a95f2f2a0e7606 inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aba08e592941465d033e3eba3dde66eaf inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">attach</a> (int <a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, int mode)</td></tr>
<tr class="memdesc:aba08e592941465d033e3eba3dde66eaf inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT). <a href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">More...</a><br /></td></tr>
@ -122,14 +122,17 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
<tr class="memitem:ab34517094faf21d4f38b36da2915132b inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top"><a id="ab34517094faf21d4f38b36da2915132b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>Bounce</b> (uint8_t <a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a>, unsigned long interval_millis)</td></tr>
<tr class="separator:ab34517094faf21d4f38b36da2915132b inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3417beb80eb6593d768c2e9884c57aa0 inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top"><a id="a3417beb80eb6593d768c2e9884c57aa0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">risingEdge</a> ()</td></tr>
<tr class="memdesc:a3417beb80eb6593d768c2e9884c57aa0 inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a3417beb80eb6593d768c2e9884c57aa0 inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac756559419bfa1c5060e5e4a4ad6406f inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top"><a id="ac756559419bfa1c5060e5e4a4ad6406f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">fallingEdge</a> ()</td></tr>
<tr class="memdesc:ac756559419bfa1c5060e5e4a4ad6406f inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:ac756559419bfa1c5060e5e4a4ad6406f inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a114878745aa1f29d3c0c293538280646 inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">getPin</a> () const</td></tr>
<tr class="memdesc:a114878745aa1f29d3c0c293538280646 inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return pin that this <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> is attached to. <a href="class_bounce.html#a114878745aa1f29d3c0c293538280646">More...</a><br /></td></tr>
<tr class="separator:a114878745aa1f29d3c0c293538280646 inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adff02eed264355c2bf90d131768f84c2 inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top"><a id="adff02eed264355c2bf90d131768f84c2"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">risingEdge</a> () const</td></tr>
<tr class="memdesc:adff02eed264355c2bf90d131768f84c2 inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:adff02eed264355c2bf90d131768f84c2 inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3ef5b85db62a7a7807f0050c86cc735f inherit pub_methods_class_bounce"><td class="memItemLeft" align="right" valign="top"><a id="a3ef5b85db62a7a7807f0050c86cc735f"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">fallingEdge</a> () const</td></tr>
<tr class="memdesc:a3ef5b85db62a7a7807f0050c86cc735f inherit pub_methods_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a3ef5b85db62a7a7807f0050c86cc735f inherit pub_methods_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_class_debouncer"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_class_debouncer')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="class_debouncer.html">Debouncer</a></td></tr>
<tr class="memitem:a34c46ca04d4178933cc0049436d10fe6 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a34c46ca04d4178933cc0049436d10fe6 inherit pub_methods_class_debouncer"><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>
@ -140,26 +143,29 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="clas
<tr class="memitem:a72f3e8d483555031d2ac21b0b7702c06 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a72f3e8d483555031d2ac21b0b7702c06 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Updates the pin's state. <a href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">More...</a><br /></td></tr>
<tr class="separator:a72f3e8d483555031d2ac21b0b7702c06 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cae68910c19c778507f257842fc41bf inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a> ()</td></tr>
<tr class="memdesc:a2cae68910c19c778507f257842fc41bf inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin's state (HIGH or LOW). <a href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">More...</a><br /></td></tr>
<tr class="separator:a2cae68910c19c778507f257842fc41bf inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ef5a04b4ebe97352ff3bb227476035c inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="a1ef5a04b4ebe97352ff3bb227476035c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a> ()</td></tr>
<tr class="memdesc:a1ef5a04b4ebe97352ff3bb227476035c inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
<tr class="separator:a1ef5a04b4ebe97352ff3bb227476035c inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9990de6fa7256842c35c246d7dea8dbb inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="a9990de6fa7256842c35c246d7dea8dbb"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a> ()</td></tr>
<tr class="memdesc:a9990de6fa7256842c35c246d7dea8dbb inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
<tr class="separator:a9990de6fa7256842c35c246d7dea8dbb inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47c83f13a03920d21fbfafd8469ec06b inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a> ()</td></tr>
<tr class="memdesc:a47c83f13a03920d21fbfafd8469ec06b inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the state changed on last update. <a href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">More...</a><br /></td></tr>
<tr class="separator:a47c83f13a03920d21fbfafd8469ec06b inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa5fcde9156f700c362fd49af5dd92ecd inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:aa5fcde9156f700c362fd49af5dd92ecd inherit pub_methods_class_debouncer"><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>
<tr class="separator:aa5fcde9156f700c362fd49af5dd92ecd inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80315de311b855f9787b4b6d5b7899e0 inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="a80315de311b855f9787b4b6d5b7899e0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a> () const</td></tr>
<tr class="memdesc:a80315de311b855f9787b4b6d5b7899e0 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
<tr class="separator:a80315de311b855f9787b4b6d5b7899e0 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab61244e043754ebdc7a156da1e1824bf inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="ab61244e043754ebdc7a156da1e1824bf"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a> () const</td></tr>
<tr class="memdesc:ab61244e043754ebdc7a156da1e1824bf inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
<tr class="separator:ab61244e043754ebdc7a156da1e1824bf inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1bbd627f9d8809b5ee9e64e9fb21e248 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a1bbd627f9d8809b5ee9e64e9fb21e248 inherit pub_methods_class_debouncer"><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>
<tr class="separator:a1bbd627f9d8809b5ee9e64e9fb21e248 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a883645ca26b4df6e5823586432104d11 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a883645ca26b4df6e5823586432104d11 inherit pub_methods_class_debouncer"><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>
<tr class="separator:a883645ca26b4df6e5823586432104d11 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac6af22dc9c6ae84462fe356b7430659e inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:ac6af22dc9c6ae84462fe356b7430659e inherit pub_methods_class_debouncer"><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>
<tr class="separator:ac6af22dc9c6ae84462fe356b7430659e inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><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>
<tr class="memdesc:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the current state. <a href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">More...</a><br /></td></tr>
<tr class="memdesc:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><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>
<tr class="separator:a462994f1f9a20876b2ee239eeee97448 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89ab95e7ac24874bb8cb684dc36a98b9 inherit pub_methods_class_debouncer"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a> ()</td></tr>
<tr class="memdesc:a89ab95e7ac24874bb8cb684dc36a98b9 inherit pub_methods_class_debouncer"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the previous state. <a href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">More...</a><br /></td></tr>
<tr class="separator:a89ab95e7ac24874bb8cb684dc36a98b9 inherit pub_methods_class_debouncer"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
@ -169,7 +175,7 @@ bool&#160;</td><td class="memItemRight" valign="bottom"><b>stateForPressed</b> =
<tr class="inherit_header pro_attribs_class_bounce"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_bounce')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="class_bounce.html">Bounce</a></td></tr>
<tr class="memitem:a1cb79cb0ba2379cd12cc7c098d97053a inherit pro_attribs_class_bounce"><td class="memItemLeft" align="right" valign="top"><a id="a1cb79cb0ba2379cd12cc7c098d97053a"></a>
uint8_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">pin</a></td></tr>
<tr class="memdesc:a1cb79cb0ba2379cd12cc7c098d97053a inherit pro_attribs_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> version 1. <br /></td></tr>
<tr class="memdesc:a1cb79cb0ba2379cd12cc7c098d97053a inherit pro_attribs_class_bounce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Deprecated (i.e. do not use). Included for partial compatibility for programs written with <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...">Bounce</a> version 1. <br /></td></tr>
<tr class="separator:a1cb79cb0ba2379cd12cc7c098d97053a inherit pro_attribs_class_bounce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pro_attribs_class_debouncer"><td colspan="2" onclick="javascript:toggleInherit('pro_attribs_class_debouncer')"><img src="closed.png" alt="-"/>&#160;Protected Attributes inherited from <a class="el" href="class_debouncer.html">Debouncer</a></td></tr>
<tr class="memitem:afab369aec42a15595ebac695a088cccd inherit pro_attribs_class_debouncer"><td class="memItemLeft" align="right" valign="top"><a id="afab369aec42a15595ebac695a088cccd"></a>
@ -271,7 +277,7 @@ void&#160;</td><td class="memItemRight" valign="bottom"><b>begin</b> ()</td></tr
<li>src/<a class="el" href="_bounce2_8h_source.html">Bounce2.h</a></li>
</ul>
</div><!-- contents -->
<div class="ttc" id="aclass_bounce2_1_1_button_html_a18710b645862d2b8f058a73aabbaf7ad"><div class="ttname"><a href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button::Button</a></div><div class="ttdeci">Button()</div><div class="ttdoc">Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:260</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a18710b645862d2b8f058a73aabbaf7ad"><div class="ttname"><a href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button::Button</a></div><div class="ttdeci">Button()</div><div class="ttdoc">Create an instance of the Button class. By default, the pressed state is matched to a HIGH electrical...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:290</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">

@ -69,21 +69,22 @@ $(function() {
<p>This is the complete list of members for <a class="el" href="class_debouncer.html">Debouncer</a>, including all inherited members.</p>
<table class="directory">
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>begin</b>() (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>durationOfPreviousState</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(uint16_t interval_millis)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>interval_millis</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>readCurrentState</b>()=0 (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>state</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>stateChangeLastTime</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">currentDuration</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">duration</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">inline</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>durationOfPreviousState</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>(uint16_t interval_millis)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr bgcolor="#f0f0f0"><td class="entry"><b>previous_millis</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">previousDuration</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>readCurrentState</b>()=0 (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span><span class="mlabel">pure virtual</span></td></tr>
<tr><td class="entry"><a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a>() const</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
<tr bgcolor="#f0f0f0" class="even"><td class="entry"><b>state</b> (defined in <a class="el" href="class_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</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_debouncer.html">Debouncer</a>)</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"><span class="mlabel">protected</span></td></tr>
<tr class="even"><td class="entry"><a class="el" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>()</td><td class="entry"><a class="el" href="class_debouncer.html">Debouncer</a></td><td class="entry"></td></tr>
</table></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>

@ -81,7 +81,7 @@ Inheritance diagram for Debouncer:</div>
<div class="center">
<img src="class_debouncer.png" usemap="#Debouncer_map" alt=""/>
<map id="Debouncer_map" name="Debouncer_map">
<area href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin." alt="Bounce" shape="rect" coords="0,56,103,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"/>
<area href="class_bounce2_1_1_button.html" alt="Bounce2::Button" shape="rect" coords="0,112,103,136"/>
</map>
</div></div>
@ -97,26 +97,29 @@ Public Member Functions</h2></td></tr>
<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>
<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>
<tr class="separator:a72f3e8d483555031d2ac21b0b7702c06"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2cae68910c19c778507f257842fc41bf"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a> ()</td></tr>
<tr class="memdesc:a2cae68910c19c778507f257842fc41bf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the pin's state (HIGH or LOW). <a href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">More...</a><br /></td></tr>
<tr class="separator:a2cae68910c19c778507f257842fc41bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1ef5a04b4ebe97352ff3bb227476035c"><td class="memItemLeft" align="right" valign="top"><a id="a1ef5a04b4ebe97352ff3bb227476035c"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a> ()</td></tr>
<tr class="memdesc:a1ef5a04b4ebe97352ff3bb227476035c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from high to low. <br /></td></tr>
<tr class="separator:a1ef5a04b4ebe97352ff3bb227476035c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9990de6fa7256842c35c246d7dea8dbb"><td class="memItemLeft" align="right" valign="top"><a id="a9990de6fa7256842c35c246d7dea8dbb"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">rose</a> ()</td></tr>
<tr class="memdesc:a9990de6fa7256842c35c246d7dea8dbb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if pin signal transitions from low to high. <br /></td></tr>
<tr class="separator:a9990de6fa7256842c35c246d7dea8dbb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a47c83f13a03920d21fbfafd8469ec06b"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a> ()</td></tr>
<tr class="memdesc:a47c83f13a03920d21fbfafd8469ec06b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns true if the state changed on last update. <a href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">More...</a><br /></td></tr>
<tr class="separator:a47c83f13a03920d21fbfafd8469ec06b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<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>
<tr class="separator:aa5fcde9156f700c362fd49af5dd92ecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a80315de311b855f9787b4b6d5b7899e0"><td class="memItemLeft" align="right" valign="top"><a id="a80315de311b855f9787b4b6d5b7899e0"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">fell</a> () const</td></tr>
<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>
<tr class="separator:a80315de311b855f9787b4b6d5b7899e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab61244e043754ebdc7a156da1e1824bf"><td class="memItemLeft" align="right" valign="top"><a id="ab61244e043754ebdc7a156da1e1824bf"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">rose</a> () const</td></tr>
<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>
<tr class="separator:ab61244e043754ebdc7a156da1e1824bf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<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>
<tr class="separator:a1bbd627f9d8809b5ee9e64e9fb21e248"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<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>
<tr class="separator:a883645ca26b4df6e5823586432104d11"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<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>
<tr class="separator:ac6af22dc9c6ae84462fe356b7430659e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<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>
<tr class="memdesc:a462994f1f9a20876b2ee239eeee97448"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the current state. <a href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">More...</a><br /></td></tr>
<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>
<tr class="separator:a462994f1f9a20876b2ee239eeee97448"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a89ab95e7ac24874bb8cb684dc36a98b9"><td class="memItemLeft" align="right" valign="top">unsigned long&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">previousDuration</a> ()</td></tr>
<tr class="memdesc:a89ab95e7ac24874bb8cb684dc36a98b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the duration in milliseconds of the previous state. <a href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">More...</a><br /></td></tr>
<tr class="separator:a89ab95e7ac24874bb8cb684dc36a98b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
@ -168,8 +171,8 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a47c83f13a03920d21fbfafd8469ec06b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a47c83f13a03920d21fbfafd8469ec06b">&#9670;&nbsp;</a></span>changed()</h2>
<a id="a1bbd627f9d8809b5ee9e64e9fb21e248"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1bbd627f9d8809b5ee9e64e9fb21e248">&#9670;&nbsp;</a></span>changed()</h2>
<div class="memitem">
<div class="memproto">
@ -181,7 +184,7 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<td class="memname">bool Debouncer::changed </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
<td> const</td>
</tr>
</table>
</td>
@ -194,6 +197,27 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<p>Returns true if the state changed on last update. </p>
<dl class="section return"><dt>Returns</dt><dd>True if the state changed on last update. Otherwise, returns false. </dd></dl>
</div>
</div>
<a id="a883645ca26b4df6e5823586432104d11"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a883645ca26b4df6e5823586432104d11">&#9670;&nbsp;</a></span>currentDuration()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">unsigned long Debouncer::currentDuration </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</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_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>
<dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the current state. </dd></dl>
</div>
</div>
<a id="a462994f1f9a20876b2ee239eeee97448"></a>
@ -201,6 +225,9 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">unsigned long Debouncer::duration </td>
@ -209,10 +236,15 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </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_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb" title="Returns true if pin signal transitions from low to high.">rose()</a> ) or falls ( <a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c" title="Returns true if pin signal transitions from high to low.">fell()</a> ).</p>
<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>
<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>
<dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the current state. </dd></dl>
</div>
@ -243,8 +275,8 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
</div>
</div>
<a id="a89ab95e7ac24874bb8cb684dc36a98b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a89ab95e7ac24874bb8cb684dc36a98b9">&#9670;&nbsp;</a></span>previousDuration()</h2>
<a id="ac6af22dc9c6ae84462fe356b7430659e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac6af22dc9c6ae84462fe356b7430659e">&#9670;&nbsp;</a></span>previousDuration()</h2>
<div class="memitem">
<div class="memproto">
@ -253,19 +285,19 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<td class="memname">unsigned long Debouncer::previousDuration </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the duration in milliseconds of the previous state. </p>
<p>Takes the values of <a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448" title="Returns the duration in milliseconds of the current state.">duration()</a> once the pin changes state.</p>
<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>
<dl class="section return"><dt>Returns</dt><dd>The duration in milliseconds (unsigned long) of the previous state. </dd></dl>
</div>
</div>
<a id="a2cae68910c19c778507f257842fc41bf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a2cae68910c19c778507f257842fc41bf">&#9670;&nbsp;</a></span>read()</h2>
<a id="aa5fcde9156f700c362fd49af5dd92ecd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa5fcde9156f700c362fd49af5dd92ecd">&#9670;&nbsp;</a></span>read()</h2>
<div class="memitem">
<div class="memproto">
@ -274,7 +306,7 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
<td class="memname">bool Debouncer::read </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
@ -300,7 +332,7 @@ unsigned long&#160;</td><td class="memItemRight" valign="bottom"><b>durationOfPr
</div><div class="memdoc">
<p>Updates the pin's state. </p>
<p>Because <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">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>
<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>
<dl class="section return"><dt>Returns</dt><dd>True if the pin changed state. </dd></dl>
</div>

@ -69,7 +69,6 @@ $(function() {
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span id="img_0_" class="iconfopen" onclick="toggleFolder('0_')">&#160;</span><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html" target="_self">src</a></td><td class="desc"></td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a href="_bounce2_8h_source.html"><span class="icondoc"></span></a><b>Bounce2.h</b></td><td class="desc"></td></tr>
<tr id="row_0_1_" class="even"><td class="entry"><span style="width:32px;display:inline-block;">&#160;</span><a href="_bounce2_name_space_8h_source.html"><span class="icondoc"></span></a><b>Bounce2NameSpace.h</b></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->
</div><!-- contents -->

@ -72,7 +72,10 @@ $(function() {
: <a class="el" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button</a>
</li>
<li>changed()
: <a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">Debouncer</a>
: <a class="el" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">Debouncer</a>
</li>
<li>currentDuration()
: <a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">Debouncer</a>
</li>
<li>Debouncer()
: <a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>
@ -81,40 +84,43 @@ $(function() {
: <a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">Debouncer</a>
</li>
<li>fallingEdge()
: <a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">Bounce</a>
: <a class="el" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">Bounce</a>
</li>
<li>fell()
: <a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">Debouncer</a>
: <a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">Debouncer</a>
</li>
<li>getPin()
: <a class="el" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">Bounce</a>
</li>
<li>getPressedState()
: <a class="el" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">Bounce2::Button</a>
</li>
<li>interval()
: <a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">Debouncer</a>
</li>
<li>isPressed()
: <a class="el" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">Bounce2::Button</a>
</li>
<li>pin
: <a class="el" href="class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a">Bounce</a>
</li>
<li>pressed()
: <a class="el" href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">Bounce2::Button</a>
</li>
<li>previousDuration()
: <a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">Debouncer</a>
: <a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">Debouncer</a>
</li>
<li>read()
: <a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">Debouncer</a>
: <a class="el" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">Debouncer</a>
</li>
<li>released()
: <a class="el" href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">Bounce2::Button</a>
</li>
<li>risingEdge()
: <a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">Bounce</a>
: <a class="el" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">Bounce</a>
</li>
<li>rose()
: <a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">Debouncer</a>
: <a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">Debouncer</a>
</li>
<li>setPressedState()
: <a class="el" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button</a>

@ -72,7 +72,10 @@ $(function() {
: <a class="el" href="class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad">Bounce2::Button</a>
</li>
<li>changed()
: <a class="el" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">Debouncer</a>
: <a class="el" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">Debouncer</a>
</li>
<li>currentDuration()
: <a class="el" href="class_debouncer.html#a883645ca26b4df6e5823586432104d11">Debouncer</a>
</li>
<li>Debouncer()
: <a class="el" href="class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6">Debouncer</a>
@ -81,37 +84,40 @@ $(function() {
: <a class="el" href="class_debouncer.html#a462994f1f9a20876b2ee239eeee97448">Debouncer</a>
</li>
<li>fallingEdge()
: <a class="el" href="class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f">Bounce</a>
: <a class="el" href="class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f">Bounce</a>
</li>
<li>fell()
: <a class="el" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">Debouncer</a>
: <a class="el" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">Debouncer</a>
</li>
<li>getPin()
: <a class="el" href="class_bounce.html#a114878745aa1f29d3c0c293538280646">Bounce</a>
</li>
<li>getPressedState()
: <a class="el" href="class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c">Bounce2::Button</a>
</li>
<li>interval()
: <a class="el" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">Debouncer</a>
</li>
<li>isPressed()
: <a class="el" href="class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f">Bounce2::Button</a>
</li>
<li>pressed()
: <a class="el" href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">Bounce2::Button</a>
</li>
<li>previousDuration()
: <a class="el" href="class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9">Debouncer</a>
: <a class="el" href="class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e">Debouncer</a>
</li>
<li>read()
: <a class="el" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">Debouncer</a>
: <a class="el" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">Debouncer</a>
</li>
<li>released()
: <a class="el" href="class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37">Bounce2::Button</a>
: <a class="el" href="class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad">Bounce2::Button</a>
</li>
<li>risingEdge()
: <a class="el" href="class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0">Bounce</a>
: <a class="el" href="class_bounce.html#adff02eed264355c2bf90d131768f84c2">Bounce</a>
</li>
<li>rose()
: <a class="el" href="class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb">Debouncer</a>
: <a class="el" href="class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf">Debouncer</a>
</li>
<li>setPressedState()
: <a class="el" href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button</a>

@ -68,7 +68,7 @@ $(function() {
<div class="textblock">This inheritance list is sorted roughly, but not completely, alphabetically:</div><div class="directory">
<div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span>]</div><table class="directory">
<tr id="row_0_" class="even"><td class="entry"><span style="width:0px;display:inline-block;">&#160;</span><span id="arr_0_" class="arrow" onclick="toggleFolder('0_')">&#9660;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_debouncer.html" target="_self">Debouncer</a></td><td class="desc">The Debouce class. Just the deboucing code separated from all harware </td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</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">The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> class. Links the Deboucing class to a hardware pin </td></tr>
<tr id="row_0_0_"><td class="entry"><span style="width:16px;display:inline-block;">&#160;</span><span id="arr_0_0_" class="arrow" onclick="toggleFolder('0_0_')">&#9660;</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">The <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a>:<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> class. Links the Deboucing class to a hardware pin. This class is odly named, but it will be kept that so it stays compatible with previous code </td></tr>
<tr id="row_0_0_0_" class="even"><td class="entry"><span style="width:48px;display:inline-block;">&#160;</span><span class="icona"><span class="icon">C</span></span><a class="el" href="class_bounce2_1_1_button.html" target="_self">Bounce2::Button</a></td><td class="desc"></td></tr>
</table>
</div><!-- directory -->

@ -73,12 +73,12 @@ $(function() {
<p>See the bottom of this page for a basic usage example and the "examples" folder for more.</p>
<p>The library is composed of three classes:</p><ul>
<li><a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a> : The code that does the actual debouncing. Only advanced users should play with this class.</li>
<li><a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> : This is the general use library. It links the <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a> to a hardware pin on your board.</li>
<li>Button : A special version of <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> for buttons that are pressed.</li>
<li><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> : This is the general use library. It links the <a class="el" href="class_debouncer.html" title="The Debouce class. Just the deboucing code separated from all harware.">Debouncer</a> to a hardware pin on your board.</li>
<li>Button : A special version of <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> for buttons that are pressed.</li>
</ul>
<h1>INSTALLATION &amp; DOWNLOAD</h1>
<p>Install through your software's Library Manager or download the latest version <a href="https://github.com/thomasfredericks/Bounce2/archive/master.zip">here</a> and put the "Bounce2" folder in your "libraries" folder.</p>
<p>Please note that the original version of this library (<a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> 1) is included in the "extras" folder of the download but not supported anymore.</p>
<p>Please note that the original version of this library (<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> 1) is included in the "extras" folder of the download but not supported anymore.</p>
<h2>BASIC USE</h2>
<h3>INSTANTIATE</h3>
<div class="fragment"><div class="line"><span class="preprocessor">#include &lt;Bounce2.h&gt;</span></div>
@ -88,9 +88,9 @@ $(function() {
<div class="line">b.<a class="code" href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">interval</a>( &lt;INTERVAL IN MS&gt; );</div>
</div><!-- fragment --><h3>LOOP</h3>
<div class="fragment"><div class="line">b.<a class="code" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>();</div>
<div class="line"><span class="keywordflow">if</span> ( b.<a class="code" href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">changed</a>() ) { </div>
<div class="line"><span class="keywordflow">if</span> ( b.<a class="code" href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">changed</a>() ) { </div>
<div class="line"> <span class="comment">// THE STATE OF THE INPUT CHANGED</span></div>
<div class="line"> <span class="keywordtype">int</span> deboucedValue = b.<a class="code" href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">read</a>();</div>
<div class="line"> <span class="keywordtype">int</span> deboucedValue = b.<a class="code" href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">read</a>();</div>
<div class="line"> <span class="comment">// DO SOMETHING WITH THE VALUE</span></div>
<div class="line">}</div>
</div><!-- fragment --><h2>BOUNCE EXAMPLE</h2>
@ -123,7 +123,7 @@ $(function() {
<div class="line"> </div>
<div class="line"> b.<a class="code" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>(); <span class="comment">// Update the Bounce instance</span></div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> ( b.<a class="code" href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">fell</a>() ) { <span class="comment">// Call code if button transitions from HIGH to LOW</span></div>
<div class="line"> <span class="keywordflow">if</span> ( b.<a class="code" href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">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>
@ -137,7 +137,7 @@ $(function() {
<div class="line"><span class="comment"> The Button class matches an electrical state to a physical action. </span></div>
<div class="line"><span class="comment"> Use .setPressedState(LOW or HIGH) to set the detection state for when the button is pressed.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment"> INSCRUCTIONS</span></div>
<div class="line"><span class="comment"> INSTRUCTIONS</span></div>
<div class="line"><span class="comment"> ====================</span></div>
<div class="line"><span class="comment"> Set BUTTON_PIN to the pin attached to the button.</span></div>
<div class="line"><span class="comment"> Set LED_PIN to the pin attached to a LED.</span></div>
@ -190,7 +190,7 @@ $(function() {
<div class="line"> <span class="comment">// YOU MUST CALL THIS EVERY LOOP</span></div>
<div class="line"> button.<a class="code" href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">update</a>();</div>
<div class="line"> </div>
<div class="line"> <span class="keywordflow">if</span> ( button.<a class="code" href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">pressed</a>() ) {</div>
<div class="line"> <span class="keywordflow">if</span> ( button.<a class="code" href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">pressed</a>() ) {</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// TOGGLE THE LED STATE : </span></div>
<div class="line"> ledState = !ledState; <span class="comment">// SET ledState TO THE OPPOSITE OF ledState</span></div>
@ -206,7 +206,7 @@ $(function() {
<p>Please post your questions <a href="http://forum.arduino.cc/index.php?topic=266132.0">here</a>.</p>
<h1>ALTERNATE DEBOUNCE ALGORITHMS FOR ADVANCED USERS AND SPECIFIC CASES</h1>
<h2>STABLE INTERVAL</h2>
<p>By default, the <a class="el" href="class_bounce.html" title="The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.">Bounce</a> library uses a stable interval to process the debouncing. This is simpler to understand and can cancel unwanted noise.</p>
<p>By default, the <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> library uses a stable interval to process the debouncing. This is simpler to understand and can cancel unwanted noise.</p>
<p><img src="https://raw.github.com/thomasfredericks/Bounce-Arduino-Wiring/master/extras/BouncySwitch_stable.png" alt="" class="inline"/></p>
<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>
@ -221,16 +221,16 @@ $(function() {
<div class="fragment"><div class="line">#define BOUNCE_WITH_PROMPT_DETECTION</div>
</div><!-- fragment --> </div></div><!-- PageDoc -->
</div><!-- contents -->
<div class="ttc" id="aclass_bounce2_1_1_button_html"><div class="ttname"><a href="class_bounce2_1_1_button.html">Bounce2::Button</a></div><div class="ttdef"><b>Definition:</b> Bounce2.h:246</div></div>
<div class="ttc" id="aclass_debouncer_html_a1ef5a04b4ebe97352ff3bb227476035c"><div class="ttname"><a href="class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c">Debouncer::fell</a></div><div class="ttdeci">bool fell()</div><div class="ttdoc">Returns true if pin signal transitions from high to low.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:128</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html"><div class="ttname"><a href="class_bounce2_1_1_button.html">Bounce2::Button</a></div><div class="ttdef"><b>Definition:</b> Bounce2.h:276</div></div>
<div class="ttc" id="aclass_debouncer_html_a930bf3945e698d77b889f6309079857d"><div class="ttname"><a href="class_debouncer.html#a930bf3945e698d77b889f6309079857d">Debouncer::interval</a></div><div class="ttdeci">void interval(uint16_t interval_millis)</div><div class="ttdoc">Sets the debounce interval in milliseconds.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:14</div></div>
<div class="ttc" id="aclass_debouncer_html_a2cae68910c19c778507f257842fc41bf"><div class="ttname"><a href="class_debouncer.html#a2cae68910c19c778507f257842fc41bf">Debouncer::read</a></div><div class="ttdeci">bool read()</div><div class="ttdoc">Returns the pin's state (HIGH or LOW).</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:118</div></div>
<div class="ttc" id="aclass_debouncer_html_a47c83f13a03920d21fbfafd8469ec06b"><div class="ttname"><a href="class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b">Debouncer::changed</a></div><div class="ttdeci">bool changed()</div><div class="ttdoc">Returns true if the state changed on last update.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:129</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a61541ae21354cb7f5cc5bc8c05db59dd"><div class="ttname"><a href="class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd">Bounce2::Button::pressed</a></div><div class="ttdeci">bool pressed() const</div><div class="ttdoc">Returns true if the button was physically pressed</div><div class="ttdef"><b>Definition:</b> Bounce2.h:320</div></div>
<div class="ttc" id="aclass_debouncer_html_a72f3e8d483555031d2ac21b0b7702c06"><div class="ttname"><a href="class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06">Debouncer::update</a></div><div class="ttdeci">bool update()</div><div class="ttdoc">Updates the pin's state.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:32</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a3fbacfb9a631e03afcfaa5dc39686bad"><div class="ttname"><a href="class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad">Bounce2::Button::pressed</a></div><div class="ttdeci">bool pressed()</div><div class="ttdoc">Returns true if the button was physically pressed</div><div class="ttdef"><b>Definition:</b> Bounce2.h:290</div></div>
<div class="ttc" id="aclass_bounce_html"><div class="ttname"><a href="class_bounce.html">Bounce</a></div><div class="ttdoc">The Debouncer:Bounce class. Links the Deboucing class to a hardware pin.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:166</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a3c88b7938b26bca9dc2c7e72aedc442e"><div class="ttname"><a href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button::setPressedState</a></div><div class="ttdeci">void setPressedState(bool state)</div><div class="ttdoc">Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default,...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:269</div></div>
<div class="ttc" id="aclass_bounce_html"><div class="ttname"><a href="class_bounce.html">Bounce</a></div><div class="ttdoc">The Debouncer:Bounce class. Links the Deboucing class to a hardware pin. This class is odly named,...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:184</div></div>
<div class="ttc" id="aclass_bounce2_1_1_button_html_a3c88b7938b26bca9dc2c7e72aedc442e"><div class="ttname"><a href="class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e">Bounce2::Button::setPressedState</a></div><div class="ttdeci">void setPressedState(bool state)</div><div class="ttdoc">Set the electrical state (HIGH/LOW) that corresponds to a physical press. By default,...</div><div class="ttdef"><b>Definition:</b> Bounce2.h:299</div></div>
<div class="ttc" id="aclass_debouncer_html_a80315de311b855f9787b4b6d5b7899e0"><div class="ttname"><a href="class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0">Debouncer::fell</a></div><div class="ttdeci">bool fell() const</div><div class="ttdoc">Returns true if pin signal transitions from high to low.</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:128</div></div>
<div class="ttc" id="aclass_bounce_html_aba08e592941465d033e3eba3dde66eaf"><div class="ttname"><a href="class_bounce.html#aba08e592941465d033e3eba3dde66eaf">Bounce::attach</a></div><div class="ttdeci">void attach(int pin, int mode)</div><div class="ttdoc">Attach to a pin and sets that pin's mode (INPUT, INPUT_PULLUP or OUTPUT).</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:149</div></div>
<div class="ttc" id="aclass_debouncer_html_aa5fcde9156f700c362fd49af5dd92ecd"><div class="ttname"><a href="class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd">Debouncer::read</a></div><div class="ttdeci">bool read() const</div><div class="ttdoc">Returns the pin's state (HIGH or LOW).</div><div class="ttdef"><b>Definition:</b> Bounce2.cpp:118</div></div>
<div class="ttc" id="aclass_debouncer_html_a1bbd627f9d8809b5ee9e64e9fb21e248"><div class="ttname"><a href="class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248">Debouncer::changed</a></div><div class="ttdeci">bool changed() const</div><div class="ttdoc">Returns true if the state changed on last update.</div><div class="ttdef"><b>Definition:</b> Bounce2.h:130</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">

@ -1,4 +1,5 @@
var searchData=
[
['changed_5',['changed',['../class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b',1,'Debouncer']]]
['changed_5',['changed',['../class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248',1,'Debouncer']]],
['currentduration_6',['currentDuration',['../class_debouncer.html#a883645ca26b4df6e5823586432104d11',1,'Debouncer']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['debouncer_6',['Debouncer',['../class_debouncer.html',1,'Debouncer'],['../class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6',1,'Debouncer::Debouncer()']]],
['duration_7',['duration',['../class_debouncer.html#a462994f1f9a20876b2ee239eeee97448',1,'Debouncer']]]
['debouncer_7',['Debouncer',['../class_debouncer.html',1,'Debouncer'],['../class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6',1,'Debouncer::Debouncer()']]],
['duration_8',['duration',['../class_debouncer.html#a462994f1f9a20876b2ee239eeee97448',1,'Debouncer']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['fallingedge_8',['fallingEdge',['../class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f',1,'Bounce']]],
['fell_9',['fell',['../class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c',1,'Debouncer']]]
['fallingedge_9',['fallingEdge',['../class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f',1,'Bounce']]],
['fell_10',['fell',['../class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0',1,'Debouncer']]]
];

@ -1,4 +1,5 @@
var searchData=
[
['getpressedstate_10',['getPressedState',['../class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba',1,'Bounce2::Button']]]
['getpin_11',['getPin',['../class_bounce.html#a114878745aa1f29d3c0c293538280646',1,'Bounce']]],
['getpressedstate_12',['getPressedState',['../class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c',1,'Bounce2::Button']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['interval_11',['interval',['../class_debouncer.html#a930bf3945e698d77b889f6309079857d',1,'Debouncer']]],
['ispressed_12',['isPressed',['../class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676',1,'Bounce2::Button']]]
['interval_13',['interval',['../class_debouncer.html#a930bf3945e698d77b889f6309079857d',1,'Debouncer']]],
['ispressed_14',['isPressed',['../class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f',1,'Bounce2::Button']]]
];

@ -1,6 +1,6 @@
var searchData=
[
['pin_13',['pin',['../class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a',1,'Bounce']]],
['pressed_14',['pressed',['../class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad',1,'Bounce2::Button']]],
['previousduration_15',['previousDuration',['../class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9',1,'Debouncer']]]
['pin_15',['pin',['../class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a',1,'Bounce']]],
['pressed_16',['pressed',['../class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd',1,'Bounce2::Button']]],
['previousduration_17',['previousDuration',['../class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e',1,'Debouncer']]]
];

@ -1,7 +1,7 @@
var searchData=
[
['read_16',['read',['../class_debouncer.html#a2cae68910c19c778507f257842fc41bf',1,'Debouncer']]],
['released_17',['released',['../class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37',1,'Bounce2::Button']]],
['risingedge_18',['risingEdge',['../class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0',1,'Bounce']]],
['rose_19',['rose',['../class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb',1,'Debouncer']]]
['read_18',['read',['../class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd',1,'Debouncer']]],
['released_19',['released',['../class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad',1,'Bounce2::Button']]],
['risingedge_20',['risingEdge',['../class_bounce.html#adff02eed264355c2bf90d131768f84c2',1,'Bounce']]],
['rose_21',['rose',['../class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf',1,'Debouncer']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['setpressedstate_20',['setPressedState',['../class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e',1,'Bounce2::Button']]]
['setpressedstate_22',['setPressedState',['../class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e',1,'Bounce2::Button']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['update_21',['update',['../class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06',1,'Debouncer']]]
['update_23',['update',['../class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06',1,'Debouncer']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['bounce_22',['Bounce',['../class_bounce.html',1,'']]],
['button_23',['Button',['../class_bounce2_1_1_button.html',1,'Bounce2']]]
['bounce_24',['Bounce',['../class_bounce.html',1,'']]],
['button_25',['Button',['../class_bounce2_1_1_button.html',1,'Bounce2']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['debouncer_24',['Debouncer',['../class_debouncer.html',1,'']]]
['debouncer_26',['Debouncer',['../class_debouncer.html',1,'']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['attach_26',['attach',['../class_bounce.html#aba08e592941465d033e3eba3dde66eaf',1,'Bounce::attach(int pin, int mode)'],['../class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e',1,'Bounce::attach(int pin)']]]
['attach_28',['attach',['../class_bounce.html#aba08e592941465d033e3eba3dde66eaf',1,'Bounce::attach(int pin, int mode)'],['../class_bounce.html#a163477dbcbaf1a3dee6cb3b62eedf09e',1,'Bounce::attach(int pin)']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['bounce_27',['Bounce',['../class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606',1,'Bounce']]],
['button_28',['Button',['../class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad',1,'Bounce2::Button']]]
['bounce_29',['Bounce',['../class_bounce.html#aa62a2e2b5ad0ee6913a95f2f2a0e7606',1,'Bounce']]],
['button_30',['Button',['../class_bounce2_1_1_button.html#a18710b645862d2b8f058a73aabbaf7ad',1,'Bounce2::Button']]]
];

@ -1,4 +1,5 @@
var searchData=
[
['changed_29',['changed',['../class_debouncer.html#a47c83f13a03920d21fbfafd8469ec06b',1,'Debouncer']]]
['changed_31',['changed',['../class_debouncer.html#a1bbd627f9d8809b5ee9e64e9fb21e248',1,'Debouncer']]],
['currentduration_32',['currentDuration',['../class_debouncer.html#a883645ca26b4df6e5823586432104d11',1,'Debouncer']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['debouncer_30',['Debouncer',['../class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6',1,'Debouncer']]],
['duration_31',['duration',['../class_debouncer.html#a462994f1f9a20876b2ee239eeee97448',1,'Debouncer']]]
['debouncer_33',['Debouncer',['../class_debouncer.html#a34c46ca04d4178933cc0049436d10fe6',1,'Debouncer']]],
['duration_34',['duration',['../class_debouncer.html#a462994f1f9a20876b2ee239eeee97448',1,'Debouncer']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['fallingedge_32',['fallingEdge',['../class_bounce.html#ac756559419bfa1c5060e5e4a4ad6406f',1,'Bounce']]],
['fell_33',['fell',['../class_debouncer.html#a1ef5a04b4ebe97352ff3bb227476035c',1,'Debouncer']]]
['fallingedge_35',['fallingEdge',['../class_bounce.html#a3ef5b85db62a7a7807f0050c86cc735f',1,'Bounce']]],
['fell_36',['fell',['../class_debouncer.html#a80315de311b855f9787b4b6d5b7899e0',1,'Debouncer']]]
];

@ -1,4 +1,5 @@
var searchData=
[
['getpressedstate_34',['getPressedState',['../class_bounce2_1_1_button.html#ab9e2b89ad499fa4b052370140730b6ba',1,'Bounce2::Button']]]
['getpin_37',['getPin',['../class_bounce.html#a114878745aa1f29d3c0c293538280646',1,'Bounce']]],
['getpressedstate_38',['getPressedState',['../class_bounce2_1_1_button.html#a1f90c647e0c75d243cdafed16c6eb28c',1,'Bounce2::Button']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['interval_35',['interval',['../class_debouncer.html#a930bf3945e698d77b889f6309079857d',1,'Debouncer']]],
['ispressed_36',['isPressed',['../class_bounce2_1_1_button.html#a94c31de8109c89d6ee577ed9b14ea676',1,'Bounce2::Button']]]
['interval_39',['interval',['../class_debouncer.html#a930bf3945e698d77b889f6309079857d',1,'Debouncer']]],
['ispressed_40',['isPressed',['../class_bounce2_1_1_button.html#a73c7c9ef574afe8bf1a9f3eb492bfa7f',1,'Bounce2::Button']]]
];

@ -1,5 +1,5 @@
var searchData=
[
['pressed_37',['pressed',['../class_bounce2_1_1_button.html#a3fbacfb9a631e03afcfaa5dc39686bad',1,'Bounce2::Button']]],
['previousduration_38',['previousDuration',['../class_debouncer.html#a89ab95e7ac24874bb8cb684dc36a98b9',1,'Debouncer']]]
['pressed_41',['pressed',['../class_bounce2_1_1_button.html#a61541ae21354cb7f5cc5bc8c05db59dd',1,'Bounce2::Button']]],
['previousduration_42',['previousDuration',['../class_debouncer.html#ac6af22dc9c6ae84462fe356b7430659e',1,'Debouncer']]]
];

@ -1,7 +1,7 @@
var searchData=
[
['read_39',['read',['../class_debouncer.html#a2cae68910c19c778507f257842fc41bf',1,'Debouncer']]],
['released_40',['released',['../class_bounce2_1_1_button.html#a902d9df3cd993f80f59bcb205ed4be37',1,'Bounce2::Button']]],
['risingedge_41',['risingEdge',['../class_bounce.html#a3417beb80eb6593d768c2e9884c57aa0',1,'Bounce']]],
['rose_42',['rose',['../class_debouncer.html#a9990de6fa7256842c35c246d7dea8dbb',1,'Debouncer']]]
['read_43',['read',['../class_debouncer.html#aa5fcde9156f700c362fd49af5dd92ecd',1,'Debouncer']]],
['released_44',['released',['../class_bounce2_1_1_button.html#ae9bc1365cf132e57feda6dff112edbad',1,'Bounce2::Button']]],
['risingedge_45',['risingEdge',['../class_bounce.html#adff02eed264355c2bf90d131768f84c2',1,'Bounce']]],
['rose_46',['rose',['../class_debouncer.html#ab61244e043754ebdc7a156da1e1824bf',1,'Debouncer']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['setpressedstate_43',['setPressedState',['../class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e',1,'Bounce2::Button']]]
['setpressedstate_47',['setPressedState',['../class_bounce2_1_1_button.html#a3c88b7938b26bca9dc2c7e72aedc442e',1,'Bounce2::Button']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['update_44',['update',['../class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06',1,'Debouncer']]]
['update_48',['update',['../class_debouncer.html#a72f3e8d483555031d2ac21b0b7702c06',1,'Debouncer']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['bounce2_25',['Bounce2',['../namespace_bounce2.html',1,'']]]
['bounce2_27',['Bounce2',['../namespace_bounce2.html',1,'']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['bounce_202_46',['BOUNCE 2',['../index.html',1,'']]]
['bounce_202_50',['BOUNCE 2',['../index.html',1,'']]]
];

@ -1,4 +1,4 @@
var searchData=
[
['pin_45',['pin',['../class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a',1,'Bounce']]]
['pin_49',['pin',['../class_bounce.html#a1cb79cb0ba2379cd12cc7c098d97053a',1,'Bounce']]]
];

@ -36,9 +36,9 @@ void setup() {
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
// bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms

@ -66,6 +66,7 @@ void loop() {
// <Button>.pressed() RETURNS true IF THE STATE CHANGED
// AND THE CURRENT STATE MATCHES <Button>.setPressedState(<HIGH or LOW>);
// WHICH IS LOW IN THIS EXAMPLE AS SET WITH button.setPressedState(LOW); IN setup()
if ( button.pressed() ) {
// TOGGLE THE LED STATE :

@ -0,0 +1,67 @@
/*
DESCRIPTION
====================
Simple example of the Bounce library that switches on a LED when
the decounced input is held for more than 1000 milliseconds.
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT.
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE LED STATE
int ledState = LOW;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, ledState);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// GET THE STATE WITH <Bounce.read()>
int debouncedState = bounce.read();
// <Bounce>.duration() RETURNS THE TIME IN MILLISECONDS THE CURRENT STATE HAS BEEN HELD.
// SO WE CHECK IF THE STATE IS LOW AND IF IT HAS BEEN LOW FOR MORE THAN 1 SECOND.
if ( debouncedState == LOW && bounce.currentDuration() > 1000 ) {
digitalWrite(LED_PIN,HIGH); // TURN THE LED ON
} else {
digitalWrite(LED_PIN,LOW); // TURN THE LED OFF
}
}

@ -0,0 +1,73 @@
/*
DESCRIPTION
====================
When the debounced input goes from LOW to HIGH, the LED will turn on for the same time
the debounced input was held LOW.
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT.
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE INTERVAL FOR HOW LONG TO KEEP THE LED HIGH
unsigned long ledHighInterval;
// SET A VARIABLE TO STORE THE START TIME WHEN THE LED WAS TURNED HIGH
unsigned long ledHighLastTime;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, LOW);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// <Bounce>.rose() RETURNS true IF THE STATE JUST WENT FROM LOW TO HIGH
if ( bounce.rose() ) {
digitalWrite(LED_PIN, HIGH); // TURN ON THE LED
ledHighLastTime = millis();
ledHighInterval = bounce.previousDuration();
}
// IF WE HAVE TO BLINK THE LED
if ( millis() - ledHighLastTime > ledHighInterval ) {
digitalWrite(LED_PIN, LOW);
} else {
digitalWrite(LED_PIN, HIGH);
}
}

@ -0,0 +1,88 @@
/*
DESCRIPTION
====================
Simple example of the Bounce library that switches the state of a LED
when the debounced input goes from LOW to HIGH.
Also if the debounced input was previously held LOW for more than 1000 milliseconds,
the LED will blink.
Set BOUNCE_PIN to the pin attached to the input (a button for example).
Set LED_PIN to the pin attached to a LED.
*/
// WE WILL attach() THE Bounce INSTANCE TO THE FOLLOWING PIN IN setup()
#define BOUNCE_PIN 2
// DEFINE THE PIN FOR THE LED :
// 1) SOME BOARDS HAVE A DEFAULT LED (LED_BUILTIN)
#define LED_PIN LED_BUILTIN
// 2) OTHERWISE SET YOUR OWN PIN
// #define LED_PIN 13
// Include the Bounce2 library found here :
// https://github.com/thomasfredericks/Bounce2
#include <Bounce2.h>
// INSTANTIATE A Bounce OBJECT.
Bounce bounce = Bounce();
// SET A VARIABLE TO STORE THE LED STATE
int ledState = LOW;
// SET A VARIABLE TO STORE THE BLINKING STATE
bool blinkLed = false;
// SET A VARIABLE TO STORE THE LAST TIME THE LED BLINKED
unsigned long blinkLedLastTime;
void setup() {
// BOUNCE SETUP
// SELECT ONE OF THE FOLLOWING :
// 1) IF YOUR INPUT HAS AN INTERNAL PULL-UP
bounce.attach( BOUNCE_PIN , INPUT_PULLUP ); // USE INTERNAL PULL-UP
// 2) IF YOUR INPUT USES AN EXTERNAL PULL-UP
//bounce.attach( BOUNCE_PIN, INPUT ); // USE EXTERNAL PULL-UP
// DEBOUNCE INTERVAL IN MILLISECONDS
bounce.interval(5); // interval in ms
// LED SETUP
pinMode(LED_PIN, OUTPUT);
digitalWrite(LED_PIN, ledState);
}
void loop() {
// Update the Bounce instance (YOU MUST DO THIS EVERY LOOP)
bounce.update();
// <Bounce>.changed() RETURNS true IF THE STATE CHANGED (FROM HIGH TO LOW OR LOW TO HIGH)
if ( bounce.changed() ) {
// THE STATE OF THE INPUT CHANGED
// GET THE STATE
int deboucedInput = bounce.read();
// IF THE CHANGED VALUE IS HIGH
if ( deboucedInput == HIGH ) {
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState); // WRITE THE NEW ledState
// IF THE DURATION OF THE PREVIOUS STATE (LOW IN THIS CASE) WAS HELD LONGER THAN 1000 MILLISECONDS:
if ( bounce.previousDuration() > 1000 ) blinkLed = true;
else blinkLed = false;
}
}
// IF WE HAVE TO BLINK THE LED
if ( blinkLed ) {
if ( millis() - blinkLedLastTime > 500 ) {
blinkLedLastTime = millis();
ledState = !ledState; // SET ledState TO THE OPPOSITE OF ledState
digitalWrite(LED_PIN,ledState); // WRITE THE NEW ledState
}
}
}

@ -24,6 +24,8 @@ duration KEYWORD2
pressed KEYWORD2
released KEYWORD2
setPressedState KEYWORD2
currentDuration KEYWORD2
previousDuration KEYWORD2
#######################################
# Instances (KEYWORD2)

@ -6,7 +6,7 @@
"type": "git",
"url": "https://github.com/thomasfredericks/Bounce2.git"
},
"version": "2.60",
"version": "2.71",
"exclude": [
"*.png",
"*.zip"

@ -1,5 +1,5 @@
name=Bounce2
version=2.60
version=2.71
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.

@ -104,7 +104,7 @@ unsigned long Debouncer::previousDuration() const {
return durationOfPreviousState;
}
unsigned long Debouncer::duration() const {
unsigned long Debouncer::currentDuration() const {
return (millis() - stateChangeLastTime);
}

@ -129,6 +129,9 @@ public:
*/
bool changed( ) const { return getStateFlag(CHANGED_STATE); }
/**
@brief Returns the duration in milliseconds of the current state.
@ -137,7 +140,8 @@ public:
@return The duration in milliseconds (unsigned long) of the current state.
*/
unsigned long duration() const;
unsigned long currentDuration() const;
/**
@brief Returns the duration in milliseconds of the previous state.
@ -148,6 +152,19 @@ public:
*/
unsigned long previousDuration() const;
/**
@brief DEPRECATED (i.e. do not use). Renamed currentDuration().
This member function is DEPRECATED will be removed next major version. DO NOT USE IT. USE currentDuration() INSTEAD.
It was renamed to avoid confusion with previousDuration().
@return The duration in milliseconds (unsigned long) of the current state.
*/
[[deprecated]]
unsigned long duration() {
return currentDuration();
};
protected:
void begin();
virtual bool readCurrentState() =0;
@ -220,10 +237,12 @@ public:
/**
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1
*/
[[deprecated]]
bool risingEdge() const { return rose(); }
/**
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1
*/
[[deprecated]]
bool fallingEdge() const { return fell(); }
/**
@brief Deprecated (i.e. do not use). Included for partial compatibility for programs written with Bounce version 1

@ -48,6 +48,18 @@ See example sketch.
uint16_t getRenderTimeMax(void);
void resetRenderTimeMax(void);
void ControllersRefresh(void);
void setCompressor(bool comp);
bool getCompressor(void);
void setCompressorPreGain_dB(float32_t pre_gain);
void setCompressorAttack_sec(float32_t attack_sec);
void setCompressorRelease_sec(float32_t release_sec);
void setCompressorThresh_dBFS(float32_t thresh_dBFS);
void setCompressionRatio(float32_t comp_ratio);
float32_t getCompressorPreGain_dB(void);
float32_t getCompressorAttack_sec(void);
float32_t getCompressorRelease_sec(void);
float32_t getCompressorThresh_dBFS(void);
float32_t getCompressionRatio(void);
// Sound methods
void keyup(int16_t pitch);

@ -0,0 +1,427 @@
/* From https://github.com/chipaudette/OpenAudio_ArduinoLibrary */
/*
AudioEffectCompressor
Created: Chip Audette, Dec 2016 - Jan 2017
Purpose; Apply dynamic range compression to the audio stream.
Assumes floating-point data.
This processes a single stream fo audio data (ie, it is mono)
MIT License. use at your own risk.
*/
#ifndef _COMPRESSOR_H
#define _COMPRESSOR_H
#ifdef USE_DEXED_COMPRESSOR
#include <arm_math.h> //ARM DSP extensions. https://www.keil.com/pack/doc/CMSIS/DSP/html/index.html
#include "synth.h"
/*
static const float32_t zeroblock_f32[] = {
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#if AUDIO_BLOCK_SAMPLES > 16
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 32
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 48
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 64
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 80
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 96
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 112
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
#endif
#if AUDIO_BLOCK_SAMPLES > 128
#error AUDIO_BLOCK_SAMPLES > 128 is a problem for this class
#endif
};
*/
class Compressor
{
//GUI: inputs:1, outputs:1 //this line used for automatic generation of GUI node
public:
//constructor
Compressor(const float32_t sample_rate_Hz) {
//setDefaultValues(AUDIO_SAMPLE_RATE); resetStates();
setDefaultValues(sample_rate_Hz);
resetStates();
};
void setDefaultValues(const float32_t sample_rate_Hz) {
setThresh_dBFS(-20.0f); //set the default value for the threshold for compression
setCompressionRatio(5.0f); //set the default copression ratio
setAttack_sec(0.005f, sample_rate_Hz); //default to this value
setRelease_sec(0.200f, sample_rate_Hz); //default to this value
setHPFilterCoeff(); enableHPFilter(true); //enable the HP filter to remove any DC offset from the audio
}
//here's the method that does all the work
void doCompression(float32_t *audio_block, uint16_t len) {
//Serial.println("AudioEffectGain_F32: updating."); //for debugging.
if (!audio_block) {
printf("No audio_block available for Compressor!\n");
return;
}
//apply a high-pass filter to get rid of the DC offset
if (use_HP_prefilter)
arm_biquad_cascade_df1_f32(&hp_filt_struct, audio_block, audio_block, len);
//apply the pre-gain...a negative gain value will disable
if (pre_gain > 0.0f)
arm_scale_f32(audio_block, pre_gain, audio_block, len); //use ARM DSP for speed!
//calculate the level of the audio (ie, calculate a smoothed version of the signal power)
float32_t* audio_level_dB_block = (float32_t*)malloc(sizeof(float32_t)*len);
if(!audio_level_dB_block)
{
printf("Cannot allocate memory for \"audio_level_dB_block\" - stopping\n");
while(1);
}
//arm_copy_f32(zeroblock_f32,audio_level_dB_block,len);
if(audio_level_dB_block)
calcAudioLevel_dB(audio_block, audio_level_dB_block, len); //returns through audio_level_dB_block
//compute the desired gain based on the observed audio level
float32_t* gain_block=(float32_t*)malloc(sizeof(float32_t)*len);
if(!gain_block)
{
printf("Cannot allocate memory for \"gain_block\" - stopping\n");
while(1);
}
//arm_copy_f32(zeroblock_f32,gain_block,len);
if(gain_block)
{
calcGain(audio_level_dB_block, gain_block, len); //returns through gain_block
//apply the desired gain...store the processed audio back into audio_block
arm_mult_f32(audio_block, gain_block, audio_block, len);
}
//release memory
if(audio_level_dB_block)
delete(audio_level_dB_block);
if(gain_block)
delete(gain_block);
}
// Here's the method that estimates the level of the audio (in dB)
// It squares the signal and low-pass filters to get a time-averaged
// signal power. It then
void calcAudioLevel_dB(float32_t *wav_block, float32_t *level_dB_block, uint16_t len) {
// calculate the instantaneous signal power (square the signal)
float32_t* wav_pow_block=(float32_t*)malloc(sizeof(float32_t)*len);
if(!wav_pow_block)
{
printf("Cannot allocate memory for \"wav_pow_block\" - stopping\n");
while(1);
}
//arm_copy_f32(zeroblock_f32,wav_pow_block,len);
arm_mult_f32(wav_block, wav_block, wav_pow_block, len);
// low-pass filter and convert to dB
float32_t c1 = level_lp_const, c2 = 1.0f - c1; //prepare constants
for (uint16_t i = 0; i < len; i++) {
// first-order low-pass filter to get a running estimate of the average power
wav_pow_block[i] = c1*prev_level_lp_pow + c2*wav_pow_block[i];
// save the state of the first-order low-pass filter
prev_level_lp_pow = wav_pow_block[i];
//now convert the signal power to dB (but not yet multiplied by 10.0)
level_dB_block[i] = log10f_approx(wav_pow_block[i]);
}
//limit the amount that the state of the smoothing filter can go toward negative infinity
if (prev_level_lp_pow < (1.0E-13)) prev_level_lp_pow = 1.0E-13; //never go less than -130 dBFS
//scale the wav_pow_block by 10.0 to complete the conversion to dB
arm_scale_f32(level_dB_block, 10.0f, level_dB_block, len); //use ARM DSP for speed!
//release memory and return
if(wav_pow_block)
delete(wav_pow_block);
return; //output is passed through level_dB_block
}
//This method computes the desired gain from the compressor, given an estimate
//of the signal level (in dB)
void calcGain(float32_t *audio_level_dB_block, float32_t *gain_block,uint16_t len) {
//first, calculate the instantaneous target gain based on the compression ratio
float32_t* inst_targ_gain_dB_block=(float32_t*)malloc(sizeof(float32_t)*len);
if(!inst_targ_gain_dB_block)
{
printf("Cannot allocate memory for \"inst_targ_gain_dB_block\" - stopping\n");
while(1);
}
//arm_copy_f32(zeroblock_f32,inst_targ_gain_dB_block,len);
calcInstantaneousTargetGain(audio_level_dB_block, inst_targ_gain_dB_block,len);
//second, smooth in time (attack and release) by stepping through each sample
float32_t *gain_dB_block = (float32_t*)malloc(sizeof(float32_t)*len);
if(!gain_dB_block)
{
printf("Cannot allocate memory for \"gain_dB_block\" - stopping\n");
while(1);
}
//arm_copy_f32(zeroblock_f32,gain_dB_block,len);
calcSmoothedGain_dB(inst_targ_gain_dB_block,gain_dB_block, len);
//finally, convert from dB to linear gain: gain = 10^(gain_dB/20); (ie this takes care of the sqrt, too!)
arm_scale_f32(gain_dB_block, 1.0f/20.0f, gain_dB_block, len); //divide by 20
for (uint16_t i = 0; i < len; i++) gain_block[i] = pow10f(gain_dB_block[i]); //do the 10^(x)
//release memory and return
if(inst_targ_gain_dB_block)
delete(inst_targ_gain_dB_block);
if(gain_dB_block)
delete(gain_dB_block);
return; //output is passed through gain_block
}
//Compute the instantaneous desired gain, including the compression ratio and
//threshold for where the comrpession kicks in
void calcInstantaneousTargetGain(float32_t *audio_level_dB_block, float32_t *inst_targ_gain_dB_block, uint16_t len) {
// how much are we above the compression threshold?
float32_t* above_thresh_dB_block=(float32_t*)malloc(sizeof(float32_t)*len);
if(!above_thresh_dB_block)
{
printf("Cannot allocate memory for \"above_thresh_dB_block\" - stopping\n");
while(1);
}
//arm_copy_f32(zeroblock_f32,above_thresh_dB_block,len);
arm_offset_f32(audio_level_dB_block, //CMSIS DSP for "add a constant value to all elements"
-thresh_dBFS, //this is the value to be added
above_thresh_dB_block, //this is the output
len);
// scale by the compression ratio...this is what the output level should be (this is our target level)
arm_scale_f32(above_thresh_dB_block, //CMSIS DSP for "multiply all elements by a constant value"
1.0f / comp_ratio, //this is the value to be multiplied
inst_targ_gain_dB_block, //this is the output
len);
// compute the instantaneous gain...which is the difference between the target level and the original level
arm_sub_f32(inst_targ_gain_dB_block, //CMSIS DSP for "subtract two vectors element-by-element"
above_thresh_dB_block, //this is the vector to be subtracted
inst_targ_gain_dB_block, //this is the output
len);
// limit the target gain to attenuation only (this part of the compressor should not make things louder!)
for (uint16_t i=0; i < len; i++) {
if (inst_targ_gain_dB_block[i] > 0.0f) inst_targ_gain_dB_block[i] = 0.0f;
}
// release memory before returning
if(above_thresh_dB_block)
delete(above_thresh_dB_block);
return; //output is passed through inst_targ_gain_dB_block
}
//this method applies the "attack" and "release" constants to smooth the
//target gain level through time.
void calcSmoothedGain_dB(float32_t *inst_targ_gain_dB_block, float32_t *gain_dB_block, uint16_t len) {
float32_t gain_dB;
float32_t one_minus_attack_const = 1.0f - attack_const;
float32_t one_minus_release_const = 1.0f - release_const;
for (uint16_t i = 0; i < len; i++) {
gain_dB = inst_targ_gain_dB_block[i];
//smooth the gain using the attack or release constants
if (gain_dB < prev_gain_dB) { //are we in the attack phase?
gain_dB_block[i] = attack_const*prev_gain_dB + one_minus_attack_const*gain_dB;
} else { //or, we're in the release phase
gain_dB_block[i] = release_const*prev_gain_dB + one_minus_release_const*gain_dB;
}
//save value for the next time through this loop
prev_gain_dB = gain_dB_block[i];
}
return; //the output here is gain_block
}
//methods to set parameters of this module
void resetStates(void) {
prev_level_lp_pow = 1.0f;
prev_gain_dB = 0.0f;
//initialize the HP filter. (This also resets the filter states,)
arm_biquad_cascade_df1_init_f32(&hp_filt_struct, hp_nstages, hp_coeff, hp_state);
}
void setPreGain(float32_t g) { pre_gain = g; }
void setPreGain_dB(float32_t gain_dB) { setPreGain(pow(10.0, gain_dB / 20.0)); }
void setCompressionRatio(float32_t cr) {
comp_ratio = max(0.001f, cr); //limit to positive values
updateThresholdAndCompRatioConstants();
}
void setAttack_sec(float32_t a, float32_t fs_Hz) {
attack_sec = a;
attack_const = expf(-1.0f / (attack_sec * fs_Hz)); //expf() is much faster than exp()
//also update the time constant for the envelope extraction
setLevelTimeConst_sec(min(attack_sec,release_sec) / 5.0, fs_Hz); //make the level time-constant one-fifth the gain time constants
}
void setRelease_sec(float32_t r, float32_t fs_Hz) {
release_sec = r;
release_const = expf(-1.0f / (release_sec * fs_Hz)); //expf() is much faster than exp()
//also update the time constant for the envelope extraction
setLevelTimeConst_sec(min(attack_sec,release_sec) / 5.0, fs_Hz); //make the level time-constant one-fifth the gain time constants
}
void setLevelTimeConst_sec(float32_t t_sec, float32_t fs_Hz) {
const float32_t min_t_sec = 0.002f; //this is the minimum allowed value
level_lp_sec = max(min_t_sec,t_sec);
level_lp_const = expf(-1.0f / (level_lp_sec * fs_Hz)); //expf() is much faster than exp()
}
void setThresh_dBFS(float32_t val) {
thresh_dBFS = val;
setThreshPow(pow(10.0, thresh_dBFS / 10.0));
}
void enableHPFilter(boolean flag) { use_HP_prefilter = flag; };
//methods to return information about this module
float32_t getPreGain_dB(void) { return 20.0 * log10f_approx(pre_gain); }
float32_t getAttack_sec(void) { return attack_sec; }
float32_t getRelease_sec(void) { return release_sec; }
float32_t getLevelTimeConst_sec(void) { return level_lp_sec; }
float32_t getThresh_dBFS(void) { return thresh_dBFS; }
float32_t getCompressionRatio(void) { return comp_ratio; }
float32_t getCurrentLevel_dBFS(void) { return 10.0* log10f_approx(prev_level_lp_pow); }
float32_t getCurrentGain_dB(void) { return prev_gain_dB; }
void setHPFilterCoeff_N2IIR_Matlab(float32_t b[], float32_t a[]){
//https://www.keil.com/pack/doc/CMSIS/DSP/html/group__BiquadCascadeDF1.html#ga8e73b69a788e681a61bccc8959d823c5
//Use matlab to compute the coeff for HP at 20Hz: [b,a]=butter(2,20/(44100/2),'high'); %assumes fs_Hz = 44100
hp_coeff[0] = b[0]; hp_coeff[1] = b[1]; hp_coeff[2] = b[2]; //here are the matlab "b" coefficients
hp_coeff[3] = -a[1]; hp_coeff[4] = -a[2]; //the DSP needs the "a" terms to have opposite sign vs Matlab
}
private:
//state-related variables
float32_t *inputQueueArray_f32[1]; //memory pointer for the input to this module
float32_t prev_level_lp_pow = 1.0;
float32_t prev_gain_dB = 0.0; //last gain^2 used
//HP filter state-related variables
arm_biquad_casd_df1_inst_f32 hp_filt_struct;
static const uint8_t hp_nstages = 1;
float32_t hp_coeff[5 * hp_nstages] = {1.0, 0.0, 0.0, 0.0, 0.0}; //no filtering. actual filter coeff set later
float32_t hp_state[4 * hp_nstages];
void setHPFilterCoeff(void) {
//https://www.keil.com/pack/doc/CMSIS/DSP/html/group__BiquadCascadeDF1.html#ga8e73b69a788e681a61bccc8959d823c5
//Use matlab to compute the coeff for HP at 20Hz: [b,a]=butter(2,20/(44100/2),'high'); %assumes fs_Hz = 44100
float32_t b[] = {9.979871156751189e-01, -1.995974231350238e+00, 9.979871156751189e-01}; //from Matlab
float32_t a[] = { 1.000000000000000e+00, -1.995970179642828e+00, 9.959782830576472e-01}; //from Matlab
setHPFilterCoeff_N2IIR_Matlab(b, a);
//hp_coeff[0] = b[0]; hp_coeff[1] = b[1]; hp_coeff[2] = b[2]; //here are the matlab "b" coefficients
//hp_coeff[3] = -a[1]; hp_coeff[4] = -a[2]; //the DSP needs the "a" terms to have opposite sign vs Matlab
}
//private parameters related to gain calculation
float32_t attack_const, release_const, level_lp_const; //used in calcGain(). set by setAttack_sec() and setRelease_sec();
float32_t comp_ratio_const, thresh_pow_FS_wCR; //used in calcGain(); set in updateThresholdAndCompRatioConstants()
void updateThresholdAndCompRatioConstants(void) {
comp_ratio_const = 1.0f-(1.0f / comp_ratio);
thresh_pow_FS_wCR = powf(thresh_pow_FS, comp_ratio_const);
}
//settings
float32_t attack_sec, release_sec, level_lp_sec;
float32_t thresh_dBFS = 0.0; //threshold for compression, relative to digital full scale
float32_t thresh_pow_FS = 1.0f; //same as above, but not in dB
void setThreshPow(float32_t t_pow) {
thresh_pow_FS = t_pow;
updateThresholdAndCompRatioConstants();
}
float32_t comp_ratio = 1.0; //compression ratio
float32_t pre_gain = -1.0; //gain to apply before the compression. negative value disables
boolean use_HP_prefilter;
// Accelerate the powf(10.0,x) function
static float32_t pow10f(float32_t x) {
//return powf(10.0f,x) //standard, but slower
return expf(2.302585092994f*x); //faster: exp(log(10.0f)*x)
}
// Accelerate the log10f(x) function?
static float32_t log10f_approx(float32_t x) {
//return log10f(x); //standard, but slower
return log2f_approx(x)*0.3010299956639812f; //faster: log2(x)/log2(10)
}
/* ----------------------------------------------------------------------
** Fast approximation to the log2() function. It uses a two step
** process. First, it decomposes the floating-point number into
** a fractional component F and an exponent E. The fraction component
** is used in a polynomial approximation and then the exponent added
** to the result. A 3rd order polynomial is used and the result
** when computing db20() is accurate to 7.984884e-003 dB.
** ------------------------------------------------------------------- */
//https://community.arm.com/tools/f/discussions/4292/cmsis-dsp-new-functionality-proposal/22621#22621
//float32_t log2f_approx_coeff[4] = {1.23149591368684f, -4.11852516267426f, 6.02197014179219f, -3.13396450166353f};
static float32_t log2f_approx(float32_t X) {
//float32_t *C = &log2f_approx_coeff[0];
float32_t Y;
float32_t F;
int E;
// This is the approximation to log2()
F = frexpf(fabsf(X), &E);
// Y = C[0]*F*F*F + C[1]*F*F + C[2]*F + C[3] + E;
//Y = *C++;
Y = 1.23149591368684f;
Y *= F;
//Y += (*C++);
Y += -4.11852516267426f;
Y *= F;
//Y += (*C++);
Y += 6.02197014179219f;
Y *= F;
//Y += (*C++);
Y += -3.13396450166353f;
Y += E;
return(Y);
}
};
#endif
#endif

@ -23,6 +23,10 @@
*/
#include <arm_math.h>
#include <limits.h>
#include <cstdlib>
#include <stdint.h>
#include "synth.h"
#include "dexed.h"
#include "fm_core.h"
@ -32,13 +36,13 @@
#include "controllers.h"
#include "PluginFx.h"
#include <unistd.h>
#include <limits.h>
#include "porta.h"
//#include <dsp/support_functions.h>
#include <arm_math.h>
#include "compressor.h"
Dexed::Dexed(uint8_t maxnotes, int rate)
{
samplerate=float32_t(rate);
Exp2::init();
Tanh::init();
Sin::init();
@ -69,6 +73,11 @@ Dexed::Dexed(uint8_t maxnotes, int rate)
xrun = 0;
render_time_max = 0;
#ifdef USE_DEXED_COMPRESSOR
compressor = new Compressor(samplerate);
use_compressor=false;
#endif
}
Dexed::~Dexed()
@ -137,19 +146,11 @@ void Dexed::deactivate(void)
panic();
}
void Dexed::getSamples(uint16_t n_samples, int16_t* buffer)
void Dexed::getSamples(float32_t* buffer, uint16_t n_samples)
{
uint16_t i, j;
uint8_t note;
float sumbuf[n_samples];
#ifdef USE_SIMPLE_COMPRESSOR
float s;
const double decayFactor = 0.99992;
#endif
if (refreshVoice)
{
for (i = 0; i < max_notes; i++)
for (uint8_t i = 0; i < max_notes; i++)
{
if ( voices[i].live )
voices[i].dx7_note->update(data, voices[i].midi_note, voices[i].velocity, voices[i].porta, &controllers);
@ -158,63 +159,49 @@ void Dexed::getSamples(uint16_t n_samples, int16_t* buffer)
refreshVoice = false;
}
for (i = 0; i < n_samples; i += _N_)
arm_fill_f32(0.0, buffer, n_samples);
for (uint16_t i = 0; i < n_samples; i += _N_)
{
AlignedBuf<int32_t, _N_> audiobuf;
for (uint8_t j = 0; j < _N_; ++j)
{
audiobuf.get()[j] = 0;
sumbuf[i + j] = 0.0;
}
int32_t lfovalue = lfo.getsample();
int32_t lfodelay = lfo.getdelay();
for (note = 0; note < max_notes; note++)
for (uint8_t note = 0; note < max_notes; note++)
{
if (voices[note].live)
{
voices[note].dx7_note->compute(audiobuf.get(), lfovalue, lfodelay, &controllers);
for (j = 0; j < _N_; ++j)
for (uint8_t j = 0; j < _N_; ++j)
{
sumbuf[i + j] += signed_saturate_rshift(audiobuf.get()[j] >> 4, 24, 9) / 32768.0;
buffer[i + j] += signed_saturate_rshift(audiobuf.get()[j] >> 4, 24, 9) / 32768.0;
audiobuf.get()[j] = 0;
/*
int32_t val = audiobuf.get()[j];
val = val >> 4;
int32_t clip_val = val < -(1 << 24) ? 0x8000 : val >= (1 << 24) ? 0x7fff : val >> 9;
float f = ((float) clip_val) / (float) 0x8000;
if ( f > 1.0 ) f = 1.0;
if ( f < -1.0 ) f = -1.0;
sumbuf[j] += f;
audiobuf.get()[j] = 0;
*/
}
}
}
}
fx.process(sumbuf, n_samples); // Needed for fx.Gain()!!!
fx.process(buffer, n_samples); // Needed for fx.Gain()!!!
#ifdef USE_SIMPLE_COMPRESSOR
// mild compression
for (i = 0; i < n_samples; i++)
{
s = abs(sumbuf[i]);
if (s > vuSignal)
vuSignal = s;
//else if (vuSignal > 0.001f)
else if (vuSignal > 0.0005f)
vuSignal *= decayFactor;
else
vuSignal = 0.0;
}
#if defined USE_DEXED_COMPRESSOR
if(use_compressor==true)
compressor->doCompression(buffer,n_samples);
#endif
}
void Dexed::getSamples(int16_t* buffer, uint16_t n_samples)
{
float32_t tmp[n_samples];
//arm_scale_f32(sumbuf, 0.00015, sumbuf, AUDIO_BLOCK_SAMPLES);
arm_float_to_q15(sumbuf, buffer, n_samples);
getSamples(tmp, n_samples);
arm_float_to_q15(tmp, (q15_t*)buffer, n_samples);
}
void Dexed::keydown(int16_t pitch, uint8_t velo) {
@ -1499,3 +1486,65 @@ void Dexed::getName(char* buffer)
strncpy((char*)&data[DEXED_VOICE_OFFSET + DEXED_NAME], buffer, 10);
buffer[10] = '\0';
}
#ifdef USE_DEXED_COMPRESSOR
void Dexed::setCompressor(bool enable_compressor)
{
use_compressor=enable_compressor;
}
bool Dexed::getCompressor(void)
{
return(use_compressor);
}
void Dexed::setCompressorPreGain_dB(float32_t pre_gain)
{
compressor->setPreGain_dB(pre_gain);
}
void Dexed::setCompressorAttack_sec(float32_t attack_sec)
{
compressor->setAttack_sec(attack_sec,samplerate);
}
void Dexed::setCompressorRelease_sec(float32_t release_sec)
{
compressor->setRelease_sec(release_sec,samplerate);
}
void Dexed::setCompressorThresh_dBFS(float32_t thresh_dBFS)
{
compressor->setThresh_dBFS(thresh_dBFS);
}
void Dexed::setCompressionRatio(float32_t comp_ratio)
{
compressor->setCompressionRatio(comp_ratio);
}
float32_t Dexed::getCompressorPreGain_dB(void)
{
return(compressor->getPreGain_dB());
}
float32_t Dexed::getCompressorAttack_sec(void)
{
return(compressor->getAttack_sec());
}
float32_t Dexed::getCompressorRelease_sec(void)
{
return(compressor->getRelease_sec());
}
float32_t Dexed::getCompressorThresh_dBFS(void)
{
return(compressor->getThresh_dBFS());
}
float32_t Dexed::getCompressionRatio(void)
{
return(compressor->getCompressionRatio());
}
#endif

@ -23,11 +23,14 @@
*/
#define USE_DEXED_COMPRESSOR 1
#ifndef DEXED_H_INCLUDED
#define DEXED_H_INCLUDED
#include <stdint.h>
#include <stdlib.h>
#include <cstdlib>
#include <arm_math.h>
#if defined(TEENSYDUINO)
#include <Audio.h>
#endif
@ -40,6 +43,7 @@
#include "dx7note.h"
#include "lfo.h"
#include "PluginFx.h"
#include "compressor.h"
#define NUM_VOICE_PARAMETERS 156
@ -171,6 +175,20 @@ class Dexed
uint16_t getRenderTimeMax(void);
void resetRenderTimeMax(void);
void ControllersRefresh(void);
#ifdef USE_DEXED_COMPRESSOR
void setCompressor(bool comp);
bool getCompressor(void);
void setCompressorPreGain_dB(float32_t pre_gain);
void setCompressorAttack_sec(float32_t attack_sec);
void setCompressorRelease_sec(float32_t release_sec);
void setCompressorThresh_dBFS(float32_t thresh_dBFS);
void setCompressionRatio(float32_t comp_ratio);
float32_t getCompressorPreGain_dB(void);
float32_t getCompressorAttack_sec(void);
float32_t getCompressorRelease_sec(void);
float32_t getCompressorThresh_dBFS(void);
float32_t getCompressionRatio(void);
#endif
// Sound methods
void keyup(int16_t pitch);
@ -307,6 +325,7 @@ class Dexed
03, 48, // pitch_mod_sensitivity, transpose
73, 78, 73, 84, 32, 86, 79, 73, 67, 69 // 10 * char for name ("INIT VOICE")
};
float32_t samplerate;
uint8_t data[NUM_VOICE_PARAMETERS];
uint8_t max_notes;
PluginFx fx;
@ -324,7 +343,13 @@ class Dexed
VoiceStatus voiceStatus;
Lfo lfo;
FmCore* engineMsfa;
void getSamples(uint16_t n_samples, int16_t* buffer);
void getSamples(float32_t* buffer, uint16_t n_samples);
void getSamples(int16_t* buffer, uint16_t n_samples);
void compress(float32_t* wav_in, float32_t* wav_out, uint16_t n, float32_t threshold, float32_t slope, uint16_t sr, float32_t tla, float32_t twnd, float32_t tatt, float32_t trel);
#ifdef USE_DEXED_COMPRESSOR
bool use_compressor;
Compressor* compressor;
#endif
};
#endif

@ -15,30 +15,142 @@
*/
#include <math.h>
#include <cstdlib>
#include <stdint.h>
#ifdef HAVE_NEON
#include <cpu-features.h>
#ifdef __ARM_NEON
#include <arm_neon.h>
#endif
#include "synth.h"
#include "sin.h"
#include "fm_op_kernel.h"
#ifdef HAVE_NEON
static bool hasNeon() {
return true;
return (android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_NEON) != 0;
}
#ifdef __ARM_NEON
extern "C"
void neon_fm_kernel(const int *in, const int *busin, int *out, int count,
int32_t phase0, int32_t freq, int32_t gain1, int32_t dgain);
#else
static bool hasNeon() {
return false;
const int32_t __attribute__ ((aligned(16))) const_0_1_2_3_arg[4] = {0, 1, 2, 3};
const int32_t __attribute__ ((aligned(16))) mask23_arg = 0x7fffff;
const float32_t __attribute__ ((aligned(16))) coeffs_arg[4] = {
-0.01880853017455781, 0.25215252666796095, -1.2333439964934032, 1.0
};
const int32_t __attribute__ ((aligned(16))) zeros[_N_] = {0};
void neon_fm_kernel(const int *in, const int *busin, int *out, int count,
int32_t phase0, int32_t freq_arg, int32_t gain1_arg, int32_t dgain_arg) {
int32x4_t phase = vld1q_dup_s32(&phase0);
int32x4_t freq = vld1q_dup_s32(&freq_arg);
int32x4_t const_0_1_2_3 = vld1q_s32(const_0_1_2_3_arg);
phase = vmlaq_s32(phase, freq, const_0_1_2_3);
int32x4_t gain1 = vld1q_dup_s32(&gain1_arg);
int32x4_t dgain = vld1q_dup_s32(&dgain_arg);
gain1 = vmlaq_s32(gain1, dgain, const_0_1_2_3);
int32x4_t mask23 = vld1q_dup_s32(&mask23_arg);
float32x4_t coeffs = vld1q_f32(coeffs_arg);
float32x4_t gainf = vcvtq_n_f32_s32(gain1, 24);
int32x4_t freq4 = vshlq_n_s32(freq, 2);
float32x4_t dgainf = vcvtq_n_f32_s32(dgain, 22);
count -= 4;
int32x4_t q15 = vmovq_n_s32(0x800000);
int32x4_t q7 = vmovq_n_s32(0x400000);
while (true) {
int32x4_t phase4 = vaddq_s32(phase, freq4);
int32x4_t phase8 = vaddq_s32(phase4, freq4);
int32x4_t data1a = vld1q_s32(in);
data1a = vaddq_s32(data1a, phase);
int32x4_t data1b = vld1q_s32(in + 4);
data1b = vaddq_s32(data1b, phase4);
int32x4_t data1c = vld1q_s32(in + 8);
data1c = vaddq_s32(data1c, phase8);
phase = vaddq_s32(phase8, freq4);
in += 12;
int32x4_t data4a = (int32x4_t)vtstq_s32(data1a, q15);
int32x4_t data4b = (int32x4_t)vtstq_s32(data1b, q15);
int32x4_t data4c = (int32x4_t)vtstq_s32(data1c, q15);
data1a = vandq_s32(data1a, mask23);
data1b = vandq_s32(data1b, mask23);
data1c = vandq_s32(data1c, mask23);
data1a = vsubq_s32(data1a, q7);
data1b = vsubq_s32(data1b, q7);
data1c = vsubq_s32(data1c, q7);
float32x4_t fdata1a = vcvtq_n_f32_s32(data1a, 22);
float32x4_t fdata1b = vcvtq_n_f32_s32(data1b, 22);
float32x4_t fdata1c = vcvtq_n_f32_s32(data1c, 22);
fdata1a = vmulq_f32(fdata1a, fdata1a);
fdata1b = vmulq_f32(fdata1b, fdata1b);
fdata1c = vmulq_f32(fdata1c, fdata1c);
float32x4_t fdata2a = vdupq_lane_f32(vget_low_f32(coeffs), 1);
float32x4_t fdata2b = vdupq_lane_f32(vget_low_f32(coeffs), 1);
float32x4_t fdata2c = vdupq_lane_f32(vget_low_f32(coeffs), 1);
fdata2a = vmlaq_lane_f32(fdata2a, fdata1a, vget_low_f32(coeffs), 0);
fdata2b = vmlaq_lane_f32(fdata2b, fdata1b, vget_low_f32(coeffs), 0);
fdata2c = vmlaq_lane_f32(fdata2c, fdata1c, vget_low_f32(coeffs), 0);
float32x4_t fdata3a = vdupq_lane_f32(vget_high_f32(coeffs), 0);
float32x4_t fdata3b = vdupq_lane_f32(vget_high_f32(coeffs), 0);
float32x4_t fdata3c = vdupq_lane_f32(vget_high_f32(coeffs), 0);
fdata3a = vmlaq_f32(fdata3a, fdata1a, fdata2a);
fdata3b = vmlaq_f32(fdata3b, fdata1b, fdata2b);
fdata3c = vmlaq_f32(fdata3c, fdata1c, fdata2c);
fdata2a = vdupq_lane_f32(vget_high_f32(coeffs), 1);
fdata2b = vdupq_lane_f32(vget_high_f32(coeffs), 1);
fdata2c = vdupq_lane_f32(vget_high_f32(coeffs), 1);
fdata2a = vmlaq_f32(fdata2a, fdata1a, fdata3a);
fdata2b = vmlaq_f32(fdata2b, fdata1b, fdata3b);
fdata2c = vmlaq_f32(fdata2c, fdata1c, fdata3c);
fdata3a = vaddq_f32(gainf, dgainf);
fdata3b = vaddq_f32(fdata3a, dgainf);
fdata2a = vmulq_f32(fdata2a, gainf);
fdata2b = vmulq_f32(fdata2b, fdata3a);
fdata2c = vmulq_f32(fdata2c, fdata3b);
gainf = vaddq_f32(fdata3b, dgainf);
int32x4_t data3a = vcvtq_n_s32_f32(fdata2a, 24);
int32x4_t data3b = vcvtq_n_s32_f32(fdata2b, 24);
int32x4_t data3c = vcvtq_n_s32_f32(fdata2c, 24);
data1a = vld1q_s32(busin);
data1b = vld1q_s32(busin + 4);
data1c = vld1q_s32(busin + 8);
busin += 12;
data3a = veorq_s32(data3a, data4a);
data3b = veorq_s32(data3b, data4b);
data3c = veorq_s32(data3c, data4c);
data3a = vaddq_s32(data3a, data1a);
data3b = vaddq_s32(data3b, data1b);
data3c = vaddq_s32(data3c, data1c);
vst1q_s32(out, data3a);
vst1q_s32(out + 4, data3b);
vst1q_s32(out + 8, data3c);
out += 12;
count -= 12;
if (count <= 0) {
if (count == 0) {
// finish last chunk of 4
data1a = vld1q_s32(in);
data1a = vaddq_s32(data1a, phase);
data4a = (int32x4_t)vtstq_s32(data1a, q15);
data1a = vandq_s32(data1a, mask23);
data1a = vsubq_s32(data1a, q7);
fdata1a = vcvtq_n_f32_s32(data1a, 22);
fdata1a = vmulq_f32(fdata1a, fdata1a);
fdata2a = vdupq_lane_f32(vget_low_f32(coeffs), 1);
fdata2a = vmlaq_lane_f32(fdata2a, fdata1a, vget_low_f32(coeffs), 0);
fdata3a = vdupq_lane_f32(vget_high_f32(coeffs), 0);
fdata3a = vmlaq_f32(fdata3a, fdata1a, fdata2a);
fdata2a = vdupq_lane_f32(vget_high_f32(coeffs), 1);
fdata2a = vmlaq_f32(fdata2a, fdata1a, fdata3a);
fdata2a = vmulq_f32(fdata2a, gainf);
data3a = vcvtq_n_s32_f32(fdata2a, 24);
data1a = vld1q_s32(busin);
data3a = veorq_s32(data3a, data4a);
data3a = vaddq_s32(data3a, data1a);
vst1q_s32(out, data3a);
}
break;
}
}
}
#endif
@ -48,12 +160,10 @@ void FmOpKernel::compute(int32_t *output, const int32_t *input,
int32_t dgain = (gain2 - gain1 + (_N_ >> 1)) >> LG_N;
int32_t gain = gain1;
int32_t phase = phase0;
if (hasNeon()) {
#ifdef HAVE_NEON
#ifdef __ARM_NEON
neon_fm_kernel(input, add ? output : zeros, output, _N_,
phase0, freq, gain, dgain);
#endif
} else {
#else
if (add) {
for (int i = 0; i < _N_; i++) {
gain += dgain;
@ -71,6 +181,7 @@ void FmOpKernel::compute(int32_t *output, const int32_t *input,
phase += freq;
}
}
#endif
}
}
@ -79,11 +190,10 @@ void FmOpKernel::compute_pure(int32_t *output, int32_t phase0, int32_t freq,
int32_t dgain = (gain2 - gain1 + (_N_ >> 1)) >> LG_N;
int32_t gain = gain1;
int32_t phase = phase0;
if (hasNeon()) {
#ifdef HAVE_NEON
#ifdef __ARM_NEON
neon_fm_kernel(zeros, add ? output : zeros, output, _N_,
phase0, freq, gain, dgain);
#endif
#else
} else {
if (add) {
for (int i = 0; i < _N_; i++) {
@ -102,6 +212,7 @@ void FmOpKernel::compute_pure(int32_t *output, int32_t phase0, int32_t freq,
phase += freq;
}
}
#endif
}
}

@ -37,17 +37,17 @@ void AudioSynthDexed::update(void)
in_update = true;
elapsedMicros render_time;
audio_block_t *lblock;
audio_block_t *block;
lblock = allocate();
block = allocate();
if (!lblock)
if (!block)
{
in_update = false;
return;
}
getSamples(AUDIO_BLOCK_SAMPLES, lblock->data);
getSamples(block->data, AUDIO_BLOCK_SAMPLES);
if (render_time > audio_block_time_us) // everything greater audio_block_time_us (2.9ms for buffer size of 128) is a buffer underrun!
xrun++;
@ -55,88 +55,9 @@ void AudioSynthDexed::update(void)
if (render_time > render_time_max)
render_time_max = render_time;
transmit(lblock, 0);
release(lblock);
transmit(block, 0);
release(block);
in_update = false;
};
#endif
/*
// https://www.musicdsp.org/en/latest/Effects/169-compressor.html#
void compress
(
float* wav_in, // signal
int n, // N samples
double threshold, // threshold (percents)
double slope, // slope angle (percents)
int sr, // sample rate (smp/sec)
double tla, // lookahead (ms)
double twnd, // window time (ms)
double tatt, // attack time (ms)
double trel // release time (ms)
)
{
typedef float stereodata[2];
stereodata* wav = (stereodata*) wav_in; // our stereo signal
threshold *= 0.01; // threshold to unity (0...1)
slope *= 0.01; // slope to unity
tla *= 1e-3; // lookahead time to seconds
twnd *= 1e-3; // window time to seconds
tatt *= 1e-3; // attack time to seconds
trel *= 1e-3; // release time to seconds
// attack and release "per sample decay"
double att = (tatt == 0.0) ? (0.0) : exp (-1.0 / (sr * tatt));
double rel = (trel == 0.0) ? (0.0) : exp (-1.0 / (sr * trel));
// envelope
double env = 0.0;
// sample offset to lookahead wnd start
int lhsmp = (int) (sr * tla);
// samples count in lookahead window
int nrms = (int) (sr * twnd);
// for each sample...
for (int i = 0; i < n; ++i)
{
// now compute RMS
double summ = 0;
// for each sample in window
for (int j = 0; j < nrms; ++j)
{
int lki = i + j + lhsmp;
double smp;
// if we in bounds of signal?
// if so, convert to mono
if (lki < n)
smp = 0.5 * wav[lki][0] + 0.5 * wav[lki][1];
else
smp = 0.0; // if we out of bounds we just get zero in smp
summ += smp * smp; // square em..
}
double rms = sqrt (summ / nrms); // root-mean-square
// dynamic selection: attack or release?
double theta = rms > env ? att : rel;
// smoothing with capacitor, envelope extraction...
// here be aware of pIV denormal numbers glitch
env = (1.0 - theta) * rms + theta * env;
// the very easy hard knee 1:N compressor
double gain = 1.0;
if (env > threshold)
gain = gain - (env - threshold) * slope;
// result - two hard kneed compressed channels...
float leftchannel = wav[i][0] * gain;
float rightchannel = wav[i][1] * gain;
}
}
*/

Loading…
Cancel
Save