I'd like to attach 4 RGB LEDs with the ability to gradually change brightness and colour. From my understanding, I need to use the PWM ports, and there are only enough PWM ports for me to attach 2 RGB LEDs.
My question is, can I, somehow, attach 2 more without getting a second Arduino? and if so, how?
Why not use RGB leds with a build-in controller, that way you could control 100's of leds from a single output pin.
Types to look for: WS2812B or APA106 (There are many more types).
HKJ-lygte:
Why not use RGB leds with a build-in controller, that way you could control 100's of leds from a single output pin.
Types to look for: WS2812B or APA106 (There are many more types).
Thanks for the suggestion. However, I'm not simply looking to make more LEDs light up; I'm trying to make 4, independent, non-connected light sources that can change in colour and brightness.
To put it in practical terms, I want to put each of the four LEDs in a paper lantern, which will be moving at different places on my installation.
The look for a PCA9685 module, it has 16 independent PWM channels and you can connect multiple modules to a Arduino. It might be sold as a servo controller, but the chip is designed for LED driving.
Teddy_Arduino:
To put it in practical terms, I want to put each of the four LEDs in a paper lantern, which will be moving at different places on my installation.
again: "WS2812B or APA106 (There are many more types)"
--> you can controll each WS2812B or APA106 LED individually.
If you can't find information with Google, let us know.
What will be the maximum distance between the central Arduino and the lanterns?
Inferior to the other solutions presented as far as performance goes, but the other option is to use software PWM to get a PWM signal on any pin on your Arduino. There is a very nice library for doing this on the AVR-based Arduinos (e.g., Uno, Nano. Pro Mini, Leonardo):