i have a project going on that requires dark flame effects, now i have the code suitable for what i need however, i wanted to use blue and purple leds.
theres 5 flames in total with 2 leds per flame, that randomly flicker in timing and brightness. im using an arduino nano for this and as a result only 6 pwm pins.
what i wanted to ask is this: u.v leds are too dimm, i dont have the PWM pin quantity to use digital leds, that would require 10 pwm pins. so is there a way i can physically make the led itself appear to emit purple light in order for that light to illuminate a 3d printed follow flame shape?
I would go for a dual colour LED, of blue and red. One led in the package gives you the blue and both give you the purple you are after. The diodes being in the same package mix so much better. And you can lightly sandpaper the plastic for even better diffusion.
i didnt know you could get red and blue leds as a single piece to be fair. i know you can get RGB with 4 legs. which could work as i do have some already and still in the same unit.
however that would require the use of further pins which i only have one spare and i need to get all 5 flames as independent as possible. the reason for wiring that way was to give it the apperence they all doing different things.
this is why i was thinking of that for the purple, plus being able to set the color (which i assume, with my code, the color would be set below the pin setup and change the analog to digital for that pin leaving the random section of the code alone?
though i may be thinking entirely wrong here and have a different solution, if the above questions along the correct lines, i could use the ws2812b for the blues as well further reducing the required pins.
oh this is just pure led control, absolutely no other hardware involved. but its good to have it noted on the thread for anyone else who comes across this looking for help. (interrupts aka delay in this instance.)
so i need to look for a flickering effect within the fast led library i guess.
i also now need to work out where to go from there.
im googling around for information on randomly adjusting brightness of sw2812b and making them flicker randomly but only getting results about it being a problem.
You do not use analogWrite to set the pixels in a WS2812. Look at the examples that come with the Fast Led library. There are lots of ways to define colours as well.
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
that makes sense in my head, its simple, to the point and again, simple. maybe im trying to do something that isnt possible but im trying to keep it to the single delay. although another delay of 20 to clear the leds wouldnt hurt(?). this could be used i guess.
thats fine, i guess i only need one way, the question is, if using that option, how would i then make each of the 5 in the strip be a different brightness to each other?