You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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();
}
The text was updated successfully, but these errors were encountered: