Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

ME 106 Fundamentals of Mechatronics Appendix-blink4.ino Flash the four LEDs in s

ID: 3743887 • Letter: M

Question



ME 106 Fundamentals of Mechatronics Appendix-blink4.ino Flash the four LEDs in sequence, pausing DELAYTIME BETNEEN mi11iseconds between individua1 LEDS sW0 followed by a delay of DELAYTIE AFTER after the last lee. Pin 11 Pin 11 repeating forever. 0 Pin 9 Pin 6 Pin 3 Written by Eric B. Wertz for ME106 Last modified by B. Furman on February 1, 2018. LEDO Version 1.1 #define DELAYTIMEBETWEEN #define DELAYTIMEAFTER LED1 / 200 aues, (0.2) 800 (0.82) - - ,define PIN LEDO 11 #define PIN LEDI 9 #define PIN LED2 fde fine PIN LED3 ide fine PINSNO 12 LE DS - /I set of LEDs to use, and number of array elements const byte dRARARA4] . = { PIN-LEDO, PIN-LEDÌ, PIN-LED2, PIN-LED3 }; GND byte RAMedePINO, INPUT_PULLUP) Flash the LEDs specified in the array in sequence, pausing at the end only if Swo (active-low) is pressed void loop() byte d delay (DELAYTIME BETWEEN) delay (DELAYTINE BEZWEEN) delay (DELAYTIME AFTER)

Explanation / Answer

The concept is if the push button is not pressed, there is no connection between the two legs of the push button, but as it connected to ‘power’, digitalread() will return HIGH and when the push button is closed(or if its pressed) the push button connection gets complete and it will somewhere be grounded so the digitalRead() will return LOW.