Hi, I'm in an introductory Arduino class and we have a bonus assignment where we use two push buttons and each controls a different LED and the bonus part of the assignment is if we press both they both turn on and stay on ignoring the blink programming from previous instructions, I'm not quite sure how to do this or if I can do this since it will always read one before the other when I press.
Assuming that you have each button turning on an LED, just text the button pin x AND button pin Y. If both are true then set a flag. In the loop if that flag is set, then turn on both LEDS.
part of what you need to consider is what happens if one button is recognized before both are, if it matters
jacefraybane122:
Hi, I'm in an introductory Arduino class and we have a bonus assignment where we use two push buttons and each controls a different LED and the bonus part of the assignment is if we press both they both turn on and stay on ignoring the blink programming from previous instructions, I'm not quite sure how to do this or if I can do this since it will always read one before the other when I press.
Since detecting that both buttons are pressed is "ignoring the blink programming from previous instructions" then the few milliseconds between detecting one button down and two buttons down won't make a significant difference.