How to make a led-row?

Hi there!

I want to make a LED project. I have 4 LEDs and want to make my Arduino UNO to light them up:

  • Blue LED lights up
  • Red LED lights up
  • Green LED lights up
  • Yellow LED lights up
  • Blue LED goes off
  • Red LED goes off
  • Green LED goes off
  • Yellow LED goes off and so on ...

I tried myself but didn't have any things in mind. Would be nice if you could help! What could be the right command/function for this?? ..
Thanks for help!
Cheers Adam :slight_smile:

Do you have current limiting resistors on the LEDs?

Here they use 8 leds but only light one at a time. Shuffle on and off commands and you can have all your leds lit up before you turn them off.

I wonder why they don't make LED's that have resistors built in?

quamikazee:
I wonder why they don't make LED's that have resistors built in?

The value of the resistor and its power rating is a function of the circuit power supply.
You cannot just rely on one resistor.

.

How fast did you want this to happen? I mean - you could just write a series of statements in your loop to tun the LEDs on and off, but it will cycle too fast to see.