-
-
Notifications
You must be signed in to change notification settings - Fork 66
Open
Description
I need some help and are not sure if I am doing this correctly.
I am trying to use 2 buttons with different callbacks for the onPressed defined for each button.
When any of the buttons are pressed both callback's are invoked.
See code below:
int timerPin = 0;
int resetPin = 13;
EasyButton timerButton(timerPin);
EasyButton resetButton(resetPin);
void onTimerPressed() {
Serial.println("Timer Pressed);
};
void onResetPressed() {
Serial.println("Reset Pressed");
};
void setup() {
Serial.begin(9600);
timerButton.begin();
timerButton.onPressed(onTimerPressed);
resetButton.begin();
resetButton.onPressed(onResetPressed);
}
void loop() {
timerButton.read();
resetButton.read();
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels