@@ -10,13 +10,20 @@ Arduino button debounce library for various switch types, port expanders and oth
1010- Use momentary button as toggle switch (configurable)
1111- Return up to 225 codes from one button
1212
13- ## Examples
14-
15- - Lets give some examples a [ trial run] ( https://github.com/Dlloydev/Toggle/wiki/Wokwi-Examples ) .
16-
17- - See sketch [ examples] ( https://github.com/Dlloydev/Toggle/tree/main/examples ) .
13+ ## Examples (Wokwi)
1814
15+ - Do a trial run for evaluation.
16+ - Your suggestions, Issues and Discussions are welcome [ here] ( https://github.com/Dlloydev/Toggle ) .
1917
18+ | ESP32-S2 | UNO |
19+ | ------------------------------------------------------------ | ------------------------------------------------------------ |
20+ | [ Toggle_Basic] ( https://wokwi.com/projects/334453650605736531 ) | [ Toggle_Basic] ( https://wokwi.com/projects/334443631893021266 ) |
21+ | [ Use_Button_As_Toggle.ino] ( https://wokwi.com/projects/334322217034711635 ) | [ Use_Button_As_Toggle.ino] ( https://wokwi.com/projects/334321940028195411 ) |
22+ | [ Eight_Buttons.ino] ( https://wokwi.com/projects/334413532415132244 ) | [ Eight_Buttons.ino] ( https://wokwi.com/projects/334411953607803475 ) |
23+ | [ Pressed_For.ino] ( https://wokwi.com/projects/334454109412262483 ) | [ Pressed_For.ino] ( https://wokwi.com/projects/334457647787934292 ) |
24+ | [ Released_For.ino] ( https://wokwi.com/projects/334458628485415508 ) | [ Released_For.ino] ( https://wokwi.com/projects/334458460245590611 ) |
25+ | [ Retrigger_While_Pressed.ino] ( https://wokwi.com/projects/334459280465855059 ) | [ Retrigger_While_Pressed.ino] ( https://wokwi.com/projects/334458963671122515 ) |
26+ | [ Press_Code.ino] ( https://wokwi.com/projects/334320246564323924 ) | [ Press_Code.ino] ( https://wokwi.com/projects/334284248581145170 ) |
2027
2128## Toggle Library Reference
2229
@@ -26,8 +33,6 @@ To use this library
2633#include < Toggle.h>
2734```
2835
29-
30-
3136## Constructors
3237
3338``` c++
@@ -62,8 +67,6 @@ Toggle myInput(2, 3); // SPDT switch connected pins 2 and 3 to GND, INPUT_PULL
6267Toggle myInput(*Input); // Byte variable as input, debounced
6368```
6469
65-
66-
6770## poll()
6871
6972##### Description
@@ -82,16 +85,12 @@ This function is placed at the top of the loop. Initializes the Button object an
8285
8386None.
8487
85-
86-
8788## Primary Functions
8889
8990There are 5 primary functions when using 1 input pin or data bit. Shown below is a plot showing the returned values that are verically offset for clarity:
9091
9192![ image] ( https://user-images.githubusercontent.com/63488701/169307791-e4b02e03-4399-4984-87a2-755dafaf3f47.png )
9293
93-
94-
9594## onChange()
9695
9796##### Description
@@ -122,8 +121,6 @@ if (myInput.onChange() == 2) {
122121}
123122```
124123
125-
126-
127124## onPress()
128125
129126## onRelease()
@@ -155,8 +152,6 @@ if (myInput.onPress())
155152}
156153```
157154
158-
159-
160155## isPressed()
161156
162157## isReleased()
@@ -190,8 +185,6 @@ else {
190185}
191186```
192187
193-
194-
195188## toggle()
196189
197190##### Description
@@ -209,8 +202,6 @@ None.
209202
210203* true* or * false* , (* bool* ). Toggles as configured by ` setToggleTrigger() ` . Default is trigger ` onPress `
211204
212-
213-
214205## Timer Functions
215206
216207## clearTimer()
@@ -231,8 +222,6 @@ None.
231222
232223None.
233224
234-
235-
236225## blink(ms, mode)
237226
238227##### Description
@@ -257,8 +246,6 @@ This function sets the duration in milliseconds that the returned value is true.
257246
258247 [ Toggle_Basic.ino] ( https://github.com/Dlloydev/Toggle/blob/main/examples/Toggle_Basic/Toggle_Basic.ino )
259248
260-
261-
262249## pressedFor(ms)
263250
264251## releasedFor(ms)
@@ -288,8 +275,6 @@ if (myInput.pressedFor(500)) {
288275}
289276```
290277
291-
292-
293278## retrigger(ms)
294279
295280##### Description
@@ -316,8 +301,6 @@ if (retrigger(500)) {
316301}
317302```
318303
319-
320-
321304## pressCode()
322305
323306##### Description
@@ -340,12 +323,8 @@ byte pCode = sw1.pressCode(1); // (1) serial print results
340323
341324[ Trial run on * WOKWi* ] ( https://wokwi.com/projects/334284248581145170 )
342325
343-
344-
345326## Set and Get Functions
346327
347-
348-
349328## setInputMode()
350329
351330##### Description
@@ -369,8 +348,6 @@ myInput.setInputMode(sw1.inMode::input_pulldown); // pulldown resistor enabled
369348myInput.setInputMode(sw1.inMode::input_byte); // input byte (8-bit)
370349```
371350
372-
373-
374351## setInputInvert()
375352
376353##### Description
@@ -385,8 +362,6 @@ Set true if the button or switch pulls the signal high when pressed. Default is
385362
386363None.
387364
388-
389-
390365## setSampleUs()
391366
392367##### Description
@@ -401,8 +376,6 @@ Sets the sample period in microseconds. Default is 5000 μs.
401376
402377None.
403378
404-
405-
406379## getElapsedMs(()
407380
408381##### Description
@@ -417,12 +390,8 @@ Gets the elapsed ms since the last state change selected by timer mode.
417390
418391Elapsed milliseconds * (unsigned int)* .
419392
420-
421-
422393---
423394
424-
425-
426395### References
427396
428397- [ A Guide To Debouncing] ( http://www.ganssle.com/item/debouncing-switches-contacts-code.htm )
0 commit comments