-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
176 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,155 @@ | ||
#include "Hysteresis.h" | ||
|
||
// Added samples (and result) will be initialised as uint8_t, hysteresis step 10 | ||
Hysteresis <uint8_t> hysteresis(10); | ||
|
||
void setup() { | ||
Serial.begin(9600); | ||
|
||
// or you can change step here | ||
// hysteresis.step(10); | ||
|
||
Serial.print("result: 11 = "); | ||
Serial.println(hysteresis.add(11)); // insert new number and get result | ||
|
||
Serial.print("result: 12 = "); | ||
Serial.println(hysteresis.add(12)); // insert new number and get result | ||
|
||
Serial.print("result: 13 = "); | ||
Serial.println(hysteresis.add(13)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 17 = "); | ||
Serial.println(hysteresis.add(17)); // insert new number and get result | ||
|
||
Serial.print("result: 18 = "); | ||
Serial.println(hysteresis.add(18)); // insert new number and get result | ||
|
||
Serial.print("result: 19 = "); | ||
Serial.println(hysteresis.add(19)); // insert new number and get result | ||
|
||
Serial.print("result: 20 = "); | ||
Serial.println(hysteresis.add(20)); // insert new number and get result | ||
|
||
Serial.print("result: 21 = "); | ||
Serial.println(hysteresis.add(21)); // insert new number and get result | ||
|
||
Serial.print("result: 20 = "); | ||
Serial.println(hysteresis.add(20)); // insert new number and get result | ||
|
||
Serial.print("result: 19 = "); | ||
Serial.println(hysteresis.add(19)); // insert new number and get result | ||
|
||
Serial.print("result: 18 = "); | ||
Serial.println(hysteresis.add(18)); // insert new number and get result | ||
|
||
Serial.print("result: 17 = "); | ||
Serial.println(hysteresis.add(17)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 13 = "); | ||
Serial.println(hysteresis.add(13)); // insert new number and get result | ||
|
||
Serial.print("result: 12 = "); | ||
Serial.println(hysteresis.add(12)); // insert new number and get result | ||
|
||
Serial.print("result: 11 = "); | ||
Serial.println(hysteresis.add(11)); // insert new number and get result | ||
|
||
Serial.print("result: 12 = "); | ||
Serial.println(hysteresis.add(12)); // insert new number and get result | ||
|
||
Serial.print("result: 13 = "); | ||
Serial.println(hysteresis.add(13)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 17 = "); | ||
Serial.println(hysteresis.add(17)); // insert new number and get result | ||
|
||
Serial.print("result: 18 = "); | ||
Serial.println(hysteresis.add(18)); // insert new number and get result | ||
|
||
Serial.print("result: 11 = "); | ||
Serial.println(hysteresis.add(17)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 14 = "); | ||
Serial.println(hysteresis.add(14)); // insert new number and get result | ||
|
||
Serial.print("result: 15 = "); | ||
Serial.println(hysteresis.add(15)); // insert new number and get result | ||
|
||
Serial.print("result: 16 = "); | ||
Serial.println(hysteresis.add(16)); // insert new number and get result | ||
|
||
Serial.print("result: "); | ||
Serial.println(hysteresis.get()); // get last result, without adding a newone | ||
|
||
|
||
while (1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
Hysteresis KEYWORD1 | ||
get KEYWORD2 | ||
add KEYWORD2 | ||
set KEYWORD2 | ||
prev KEYWORD2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name=Hysteresis | ||
author=Pavel Slama | ||
email=Pavel Slama <[email protected]> | ||
maintainer=Pavel Slama <[email protected]> | ||
sentence=Hysteresis library | ||
paragraph= (fixed point only) | ||
url=https://github.com/pilotak/Hysteresis | ||
includes=Hysteresis.h | ||
category=Signal Input/Output | ||
version=1.0.0 | ||
architectures=* |