Hello, I am an artist who is trying to use Lilypad (Lilypad mega 328), but have some problems with programming. I would like to make 12 LED lights on and fade-off at different intervals in order to create a soft starlight effect. Could you let me know how to program the lilypad? Thank you SO much!!!
I don’t think that anyone will tell you how to program it, but you might get some help on the Arduino forums.
You are going to want to have some form of probability tester to get random twinkles. For example, if you use random(min, max) and then check to see if the output is a certain number, it will fade a light (If you check the fade example, you should be able to work it out yourself :D). Set the min to 0 and tweak the max to get the right amount of twinkles.
PS, do not forget to check to see how many PWM outputs you have; you may need more than one LilyPad to fade 12 LEDs (unless you hook up two to a pin or something).