Introduction

The days grow shorter, the night becomes colder - winter holidays means its time to get your LEDs out! What better time to experiment with NeoPixels during the day, then shine them at night?

This tutorial will cover more advanced uses of the WS2812/NeoPixel LEDs with a PIC. For a different project (which itself is yet another nested sub-project... ;-) I was working on a variation of the mechanism I used to generate the WS2812 bitstream in Madison's NeoClock.  This new approach still uses the PWM and DSM modules as before but drives it with the PIC's EUSART instead of the assembly-coded-bit-banged-PWM-edge-hopping contraption used in the clock.  Just as with the clock, there was a bit-ordering "design point" that needed some test code to verify I had it right.  This came blinking out of that effort.

Well, that bit of test code met the immediate need and looked pretty but tended to become a little monotonous after a while.  What if I coded this or maybe that instead...and the slippery slope suddenly became very slopey.  And away we went...

So, jus' thinkin': it might be nicer if there was a variety of display styles it could generate.  And of course it must have a wide palette of colors.  And brightness variations.  And it would be cool if it could somehow surprise you once in a while.  How do I wedge all of that into my little PIC?  Grab an idea, grease it up, and get a good running start...

You can follow along with your own PIC16F series with this simple design layout:

I thought it might be generally helpful if I included an inrush capacitor along with the ability to select (from a set of possiblities) how many NeoPixels it drives (another feature!).  This became this year's Pumpkin Illuminator:

It seems quite happy to run an 8x8 NeoPixel panel for hours on 3 AA's:

And so it begins with a few basic ideas...

Last updated on 2015-05-04 at 04.24.34 PM Published on 2014-10-28 at 09.15.08 PM