Hey, I'm a newbie and I need coding help!
I’ve got a project in mind I'm trying to write code for. Basically, I'm trying to put one individually-addressable pixel onto each port of a Pro Trinket and:
1— Make them fade in and out naturally, like fireflies, being able to randomize the flash speed and max brightness of each flash of each pixel between certain parameters. (I want the “fireflies” to look as natural and biological as possible to someone watching.)
2— Have a few other flash patterns (like a heartbeat) and different colors. I’m okay with having a number of programmed pattern+color pre-sets that I can just choose with the control pad I make. (I will probably assign the presets to a potentiometer switch.)
3— When switching to a new preset with the potentiometer switch, I want the code to wait to execute until the switch is on a new preset for a whole second, so that, for example, I wouldn’t start the codes for 5 different presets just trying to move 5 spots down. (I don’t know how important that is, but it seems like good practice for a switch that will change as often as this one will.)
4— Have all color and pattern changes (including turning the whole thing on and off) shift slowly over the course of maybe 5 or 10 seconds, so it never looks like an electronic switch. (Fun optional bonus: have each light change to the next preset color+pattern at a slightly different, randomized rate.)
5— Control the brightness of the whole thing all at once, and the speed of the flash pattern of the whole thing all at once, probably also through potentiometer switches on my control pad.
I've been advised that the best way to get the light fading effect I want is PWM, but I haven't gotten to the point where I grok what that means for coding.
---Design stuff:---
This project is going to be a wig that looks like there are fireflies in it. I intend to put the pixels on long strands that I can disperse easily through the wig. I haven’t quite figured out how I’m going to conceal the wires yet - maybe clear heat-shrink that I’ll paint to blend in with the wig?
For the control pad: it needs to be small, and WIRED - I need to not have to point a wireless remote at a certain spot, because this is for a theatrical thing and I need to be able to change the lights subtly on the fly. I want the control pad on a wire long enough to run down my sleeve or the inside of my clothes so I can access it easily. It also would be great if it was as small and flat as possible, but a higher priority is to find potentiometer switches that can be operated with one hand. (I might be asking for a lot here, but I really just don’t know a lot about what’s out there. I might make a separate post about designing and building the control pad, but if you have any advice to offer now, I'm all ears.)
Here are the products I'm using:
Adafruit Pro Trinket - Adafruit Pro Trinket - 5V 16MHz : ID 2000 : $9.95 : Adafruit Industries, Unique & fun DIY electronics and kits
These pixels - https://www.amazon.com/gp/product/B01DC0J3UM/
This FTDI breakout board that was recommended to me - https://www.amazon.com/gp/product/B0068QKQEA/
I've attached a picture of approximately what it should look like. Those are fairy lights on copper wire, which are beautiful but not very customizable (and very uncooperative in wigs).