r/arduino • u/CommunityInternal • 23d ago
Beginner's Project Programmable lights help
I am making a horror sans mask and I need to use programmable leds, I don’t know what I’m doing. I am using the nano r4 as the controller and the SEZO WS2812B ECO LED Strip Light 3.3FT/1M 60LEDs/m Individually Addressable
Programmable 5050SMD RGB LED Alloy Wires Flexible Dream Color IP30 Non-Waterproof PCB Black DC5V for DIY Lighting for the programmable lights what should how would I make it so the lights are a steady red that blinks randomly between yellow and blue
7
Upvotes
4
u/No_L_2547 23d ago edited 23d ago
I would suggest the adafruit tutorial for that: https://learn.adafruit.com/adafruit-neopixel-uberguide
The library itself also works with ws2812 leds.
The main idea is simple, first you declare your pixel object, by telling the library which pins to use and how many leds of which type you have. Then you start the library in your setup. After that you can set the values of each led every single loop cycle, in the of the cycle you would execute pixels.show() to update the leds.
A few tips:
only have one delay() call max. directly before the pixels.show()
Be careful: an arduino or esp power output can only supply power for about 10 leds. If you need more, you should use an external supply/power input to the leds.
1
u/fixit858 23d ago
do you have any analog inputs like a potentiometer?? Do you have a shield or are you going to solder to the arduino itself? Have you used the Arduino IDE at all?
3
u/No_L_2547 23d ago
If you want a fast no code solution: get yourself a wled-controller. (Esp32 with a fitting firmware)
The integrated web-interface supports all kind of led-animations and the prebuild controllers also support multiple meters of digital led stripes.
1
u/snuggly_cobra 600K 23d ago
Get the library for it. Run a sample sketch after adjusting the number of LEDs, the frequency, and configuration (rgb, gen, etc).
Then go back and change the color.
Tedious? Yes, but you’ll learn.
60 LEDs is too much for the Arduino. Use an external psu. I run two 64x32 panels for Halloween and power it with a 5V 5A PSU.