Skip to content

Commit

Permalink
modified: examples/Debounce/Debounce.ino
Browse files Browse the repository at this point in the history
	modified:   examples/button-pulldown/button-pulldown.ino
	modified:   examples/button-pullup/button-pullup.ino
	modified:   src/ExponentialFilter.cpp
	modified:   src/ExponentialFilter.h
  • Loading branch information
MicroBeaut committed Apr 16, 2024
1 parent 1b1c3ff commit f8fb554
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion examples/Debounce/Debounce.ino
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ void setup() {
}

void loop() {
expButton.expFilter(digitalRead(BUTTON_PIN));
expButton.filter(digitalRead(BUTTON_PIN));
expButton.schmittTrigger(&trigger);
if (trigger.upperRising) toggle = !toggle;
digitalWrite(LED_BUILTIN, toggle);
Expand Down
2 changes: 1 addition & 1 deletion examples/button-pulldown/button-pulldown.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void setup() {
}

void loop() {
expButton.expFilter(!digitalRead(BUTTON_PIN)); // INPUT = INVERT INPUT
expButton.filter(!digitalRead(BUTTON_PIN)); // INPUT = INVERT INPUT
expButton.schmittTrigger(&trigger);
if (trigger.upperRising) toggle = !toggle;
digitalWrite(LED_BUILTIN, toggle);
Expand Down
2 changes: 1 addition & 1 deletion examples/button-pullup/button-pullup.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void setup() {
}

void loop() {
expButton.expFilter(digitalRead(BUTTON_PIN));
expButton.filter(digitalRead(BUTTON_PIN));
expButton.schmittTrigger(&trigger);
if (trigger.upperRising) toggle = !toggle;
digitalWrite(LED_BUILTIN, toggle);
Expand Down
2 changes: 1 addition & 1 deletion src/ExponentialFilter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void ExponentialFilter::mode(bool mode) {
}


float ExponentialFilter::expFilter(float input) {
float ExponentialFilter::filter(float input) {
unsigned long currTime = micros();
unsigned long elapsedTime = currTime - _lastTime;
_lastTime = currTime;
Expand Down
2 changes: 1 addition & 1 deletion src/ExponentialFilter.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class ExponentialFilter {
void timeConstant(float timeConstant);
void mode(bool mode);
void init(float input);
float expFilter(float input);
float filter(float input);
bool schmittTrigger(ExpTrigger *trigger);
};

Expand Down

0 comments on commit f8fb554

Please sign in to comment.