Skip to content

Commit

Permalink
corrected TripleClick function name
Browse files Browse the repository at this point in the history
Corrected TripleClick fubction name - now with just one 'p' :-) : tripleClick() instead of trippleClick().
You need to correct the function name in our application: remove extra 'p' letter. Sorry for inconvinience.
  • Loading branch information
ShaggyDog18 committed Jul 9, 2020
1 parent 6adc664 commit ada95e1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ http://www.mathertel.de/Arduino/OneButtonLibrary.aspx

**Major modification**:
- added new functions:
- `trippleClickFunc()` for multiple 3+ clicks (for 3 clicks and more)
- `tripleClickFunc()` for multiple 3+ clicks (for 3 clicks and more)
- `getNumberClicks()` to return number of multiple clicks;

## Change Log:

12.02.2020:
- modified state machine (still same number of states), maintained full compatibility with the initial library;
- introduced a new functions: `trippleClickFunc()` for multiple 3+ clicks; `getNumberClicks()` to return number of clicks;
- introduced a new functions: `tripleClickFunc()` for multiple 3+ clicks; `getNumberClicks()` to return number of clicks;
- optimized - changed some types of variables (f.e.: `bool _buttonPressed`, `uint8_t _state`) to compact the code;
- optimized - by using `switch()` instead of multiple `if()`-s;
- introdiced `#define PARAM_FUNC` - if commented in `oneButton.h`, the call functions with parameters will not be used to save space;
- modified `SimpleOneButton` example to test more functions incl. new `trippleClickFunc()` and `getNumberClicks()` functions.
- modified `SimpleOneButton` example to test more functions incl. new `tripleClickFunc()` and `getNumberClicks()` functions.

23.06.2020:
- sync up with the original library, release v1.5, by adding the new function `attachPressStart()`.
Expand Down Expand Up @@ -134,7 +134,7 @@ Here's a full list of events handled by this library:
| ----------------------- | ---------------------------------------------------------- |
| `attachClick` | Fires as soon as a single click is detected. |
| `attachDoubleClick` | Fires as soon as a double click is detected. |
| `attachTrippleClick` | Fires as soon as tripple click or more clicks are detected.|
| `attachTripleClick` | Fires as soon as triple click or more clicks are detected. |
| `attachPressStart` | **NEW** Fires as soon as the button is pressed down. |
| `attachLongPressStart` | Fires as soon as the button is held down for 1 second. |
| `attachDuringLongPress` | Fires periodically as long as the button is held down. |
Expand Down
6 changes: 3 additions & 3 deletions src/OneButton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,15 +112,15 @@ void OneButton::attachDoubleClick(parameterizedCallbackFunction newFunction, voi
// save function for tripleClick event
void OneButton::attachTripleClick(callbackFunction newFunction) {
_tripleClickFunc = newFunction;
} // attachTrippleClick
} // attachTripleClick
#ifdef PARAM_FUNC
// save function for parameterized doubleClick event
void OneButton::attachTripleClick(parameterizedCallbackFunction newFunction, void* parameter) {
_paramTripleClickFunc = newFunction;
_tripleClickFuncParam = parameter;
} // attachTrippleClick
} // attachTripleClick
#endif
// ShaggyDog ---- Tripple and Multiple Clicks ----
// ShaggyDog ---- Triple and Multiple Clicks ----


// save function for press event
Expand Down
6 changes: 3 additions & 3 deletions src/OneButton.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
// 29.01.2020 ShaggyDog18: optimized by using switch() instead of multiple if()-s; PARAM_FUNC functions are optional to save space
// 12.02.2020 ShaggyDog18: Modification Log:
// - modified the State Machine (still the same number of states), maintained full compatibility with initial Author development
// - introduced new functions: trippleClickFunc() for 3+ clicks; getNumberClicks() to return number of clicks;
// - introduced new functions: tripleClickFunc() for 3+ clicks; getNumberClicks() to return number of clicks;
// - optimized - changed some types of variables (f.e.: bool _buttonPressed, uint8_t _state) to compact the code
// - modified SimpleOneButton example to test more functions incl. new trippleClickFunc() and getNumberClicks() functions
// - modified SimpleOneButton example to test more functions incl. new tripleClickFunc() and getNumberClicks() functions
// -----

#ifndef OneButton_h
Expand Down Expand Up @@ -88,7 +88,7 @@ class OneButton {
#endif

/**
* Attach an event to be called after a tripple and more clicks are detected.
* Attach an event to be called after a triple and more clicks are detected.
* @param newFunction
*/
void attachTripleClick(callbackFunction newFunction);
Expand Down

0 comments on commit ada95e1

Please sign in to comment.