Have any of you experimented w/ the "shimmer" effect? I'm playing around w/ the basic "fade" sketch to see if stepping one LED up while the other counts down, and adding in a bright and off to break up the pulse a bit.
int blue = 9; // pure blue pwm
int rblue = 5; // royal blue pwm
int brightblue = 150; // minimum LED brightness
int brightrblue = 255; // maximum LED brightness
int fadeAmount = 5; // how many points to fade the LED by
void setup() {
// declare pin 9 and 5 pints to be outputs
pinMode(blue, OUTPUT);
pinMode(rblue, OUTPUT);
}
void loop() {
// set the brightness of the pins to high and low
analogWrite(rblue, brightrblue);
analogWrite(blue, brightblue);
// true blue goes up while royal blue goes down
brightblue = brightblue + fadeAmount;
brightrblue = brightrblue - fadeAmount;
// reverse the direction of the fading at the ends of the fade:
if (brightblue == 150 || brightblue == 255) {
fadeAmount = -fadeAmount ;
// go bright and off to break up the straight pulsing effect
analogWrite(rblue, 255);
analogWrite(blue, 0);
}
// wait for 5 milliseconds to see the dimming effect
delay(5);
}
Any other ideas on how to achieve a shimmer effect w/ 1-3 LEDs (vs a LED string)?