Controlling Multiple LEDs with Arduino – Pre-Test | Lesson 6


It saves lines of code and is easier to update
It uses more memory
It makes the LEDs brighter

To set the pin as input or output
To send voltage to a pin
To read sensor values

Pauses the program for 0.5 seconds
Turns off the LED
Starts the program

for loop
if statement
analogWrite

digitalWrite(pin, HIGH)
analogWrite(pin, 0)
pinMode(pin, HIGH)

LEDs turn on and off in the opposite direction
Code will not compile
All LEDs will blink at once

More pins and changes in loop range
Using analog pins only
Using smaller delay

Change the delay time
Use analogWrite
Use more LEDs

Connect it to a new digital pin and update your code
Use a second Arduino
Change the power supply

Use a condition that only runs for even pin numbers
Set the delay to zero
Delete the for loop