The title of this post is a little throwback to my childhood. My family would go to the Shrine Circus when it was in the area. One year the featured toy was this brightly colored plastic gun that, when you pulled the trigger, was basically a flashlight. The barker wanted everybody to "make sure you get your winking blinking flashing light!" It's funny what things stick with you from your childhood!
One thing that didn't dawn on me right away when starting this project was that when I previously had played with the WS2812B addressble LEDs was that it was with an Arduino. The Arduino I was using had 5v logic. The WS2812Bs also have 5v logic. The ESP32 has 3.3v logic. No real problem there, I've used level shifters before. It added a little more complexity to the project than what I was initially hoping for, but certainly doable. I even have a few left from a previous project. But, as I was searching for how to hook up the level shifters again (remember, electronics is a hobby, not my day job) I came across a video that talked about how the level shifters like mine were slow and could cause issues updating the LEDs at a higher pace. I hadn't really intended to be updating my LEDs quickly, but it did give me pause. The same video recommended another level shifting IC that was fast enough to handle the job, but I didn't have any of those. I could get them on Amazon, but... I kept searching. Then I stumbled across this ingenious little hack! Just by using a diode to go from the 5v pin on the ESP32 to the power of the first WS2812B, that drops the voltage just enough to allow 3.3v logic to work. Then you power the rest of the LEDs with the full 5v. And it works great! If none of that made any sense, here's the article that explains it.
With my power hack in place, and some help from the FastLED library, I can now control WS2812B LEDs! Combine that with the WebThings control and I can set the color and intensity. Also, by using the Actions built in to the WebThings API, I can trigger things like a rainbow mode (which FastLED makes insanely easy to do), or a timed fade! There's another checkbox! This is turning out to be a very cool Winking Blinking Flashing Light!
I have fallen down a little bit on chronicling this little adventure. One, I'm writing these posts after the fact, not really as I go. And as I write them, I've realized I haven't taken any pictures or video of this thing in action. And, for reasons you'll see in the next post, I can't really go back and take fill in shots. I'll try to be better going forward.