I absolutely love the idea! This looks super slick!
Pretty cool that you've started using PIR's as well - I've just ordered a bag of 10 for $10. Couldn't resist.
I'm planning of using them for an alarm system I'm planning to build together with my brother-in-law (he's the handy guy when it comes to building cases and such).
Glad to hear my pre-coffee code worked haha ...
// Fill the dots one after the other with a color
void colourWipeUp(uint32_t c, uint8_t wait) {
// Convert 32 bit to 3x 8 bit RGB
uint8_t
r = (uint8_t)(c >> 16),
g = (uint8_t)(c >> 8),
b = (uint8_t)c;
// Do 4 LEDs, slowly brining up brightness
// Brightness goes from 0 .. 255
for(uint16_t i=strip.numPixels(); i < -1; i=i-4) {
for(int brightness=2; brightness <= 256; brightness=brightness*2) {
for(int countFour=0; countFour < 4; ++countFour) {
strip.setPixelColor(i+countFour, (r * brightness) >> 8, (r * brightness) >> 8, (r * brightness) >> 8 );
strip.show();
// delay(50); // possible delay here
}
}
}
}
I guess the ideal fade in/out would be per block of 4 and in that block slowly fade each individual.
For now my first attempt would be adding a few delays (which would not accomplish what I've just said) - maybe this would make it smoother, but a more natural flow would be preferred of course ...
// Fill the dots one after the other with a color
void colourWipeUp(uint32_t c, uint8_t wait) {
// Convert 32 bit to 3x 8 bit RGB
uint8_t
r = (uint8_t)(c >> 16),
g = (uint8_t)(c >> 8),
b = (uint8_t)c;
// Do 4 LEDs, slowly brining up brightness
// Brightness goes from 0 .. 255
for(uint16_t i=strip.numPixels(); i < -1; i=i-4) {
for(int brightness=2; brightness <= 256; brightness=brightness*2) {
for(int countFour=0; countFour < 4; ++countFour) {
strip.setPixelColor(i+countFour, (r * brightness) >> 8, (r * brightness) >> 8, (r * brightness) >> 8 );
strip.show();
delay(50); // possible delay here
}
delay(100);
}
}
}
I really need to get my hands on a few WS2812 LEDs so i can experiment along with you ...
Let me see how fast I can get a few strands ... (I'm staying at family in Europe right now - see if I can find some local shop that can provide these LEDs ... I have PIR's and probably can find an LDR somewhere in my dad's stuff as well!)