Question: Problem 1. Consider the following example code // The higher the number, the slower the int timer-100 timing void setup() f // use a for

Problem 1. Consider the following example code // The higher the number, the slower the int timer-100 timing void setup() f // use a for loop to initialize each pin as an output: for (int thisPin2; thisPin2; thisPin- digitalwrite(thisPin, HIGH); II turn the pin on delay (timer) digitalwrite(thisPin, LOW): 1/ turn the pin off (a) Rewrite the setup) function, without using the for loop. Do not use a loop of any kind. (b) Assume that pins 2 to 7 have an LED attached to each pin. Rewrite the code in the loop() function to turn on the LEDs of pins 2 and 7 simultaneously for 100 ms, and then off for 100 ms, then pins 3 and 6 on for 100 ms, then off for 100 ms and then pins 4 and 5 on for 100 ms, and then off for 100 ms. Reverse the sequence, lighting pins 4 and 5, then 3 and 6, and then 2 and 7. Repeat. (c) Rewrite the loop in the setup) function by using the while)loop instead of the for loop. Look up the syntax in
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
