Coding for the LEDiva™

Tonight I got some real headway on my small LED driver. I added the ability to change the number of NeoPixels that are displayed, then update the onboard flash memory so that the ATtiny remembers what you selected even after a power cycle.

So now if you press and hold either of the two buttons, then turn the board on, it will let you select the number of LEDs to use. Just press the Color or Mode buttons to add or remove an LED address.

Q: why would I want to change the number of LEDs that I am using on the fly?

A: Basically, the LEDiva™ is intended to be a generic all purpose NeoPixel driver. You could use 140 NeoPixels, or just one. Some of the animations, like colorWipe();, start with the first LED address and loop until it gets to the last LED, as defined by the number of Pixels the NeoPixel library was told are available on startup. There is no way for the LEDs to tell the micro controller how many of them you just connected. So the animations will just run all the way out to 140 LEDs be damned. This can slow things as down if you are only using 3 physical LED. To fix this I simply tell the NeoPixel library that I want to use all 140, but make it so that the loop that updates the LEDs stops when it reaches the user defined number of LEDs.

So if you use the new sequence to tell the LEDiva™ that you want to use 3 LEDs, it will only loop LED updates 3 time rather than 140. Now that I have added storage to the EEPROM, it will remember the number of LEDs you selected the next time you turn it on. Are it and forget it.

Here is the latest code I have:

Now I just need to save the color and mode to EEPROM, but I will save that for another day :)

LEDiva™ rev A sent to FAB

Yesterday I sent a new revision of my drop-in NeoPixel board, the LEDiva™, that included the new service mounted battery connector as well as a six pin programming connection.

image

This is the first step in getting the chip as small as possible. The next revision will replace the through hole version of the ATTiny 85 with a surface mounted version. After that, I will try to add a charging circuit to the board so that the battery can be charged via micro USB cable.

I do still need to work on the firmware to save data to the EPROM so it will remember the last color and pattern selected on startup. I have also thought of a way to select the number of LEDs that are being used so that the more elaborate animations look better.

image

The LEDiva™ is made to be used with up to 140 LEDs with unique addresses. Since I am mostly just going to sell the controller board, I do not know how many LEDs any one person will be using. So I will like have the default LED number set as 30, then create a scenario were you can use the two buttons to turn more LEDs on or off. Once you exit the LED selection mode, it will remember the number of LEDs. The sequence will likely be something like; press and hold one of the buttons on startup, then press and hold both buttons for 5 seconds to lock in the new settings.

I will do a video of me assembling the first rev A board when it comes back from OSH Park.

Weather Cloud Project Update

I have ported the code over to the Particle Photon and am working on some new lighting and sounds to represent data being sent to the device.

Thanks to James Bruce and his How to Build a Cloud Lamp with Sound Reactive Lightning tutorial, I think I have found a cool Thunder animation.