Category Archives: Arduino

Florabrella Project Done (LED Umbrella from Adafruit)

UntitledThis is a fun project from Adafruit. I didn’t track creation as they does a pretty good job of walking you through it. It was a bigger hit with the neighborhood kids than I expected. Their favorite thing was to turn it sideways and spin it.

  2015-03-26 20.20.50 2015-03-26 20.20.47 2015-03-26 20.14.33


johnny5When I was talking with the family about getting setup for electronics projects, I first tried the robot approach. Unfortunately, Johnny 5 didn’t fly with my daughter.

So I tried Adafruit’s various projects (mostly wearables) and many of them tested well with the target market. We settled on:

RGB LED with Fixed Brightness

Fading the RGB LED was fun to figure out but it was too “blinky” to use for most things I could image. I wanted to have it fade smoothly through the available spectrum AND stay at a constant brightness. Here is the slightly-more-zen-less-blinky RGB LED:

The code below is an update of the previous code. It uses a very simple normalization method – just scale everything by the same amount to reach a target brightness.

By the way, this was developed on codebender and I’d like to say thanks to them for the excellent site and tools. In fact, you can run the code below on your arduino directly from this page.

Bugfix on Piezo Music Example (Circuit 06)

Updated: From the friendly people at who make the ARDX:

Thanks for explaining the issue to us, we’ll get it marked to be fixed in the next update run.

Going through the ARDX tutorials, the piezo music one was nice and simple. However when I listened to the output, there was something off. It wasn’t keeping the beat. You can hear it below at the end of the 7th note (Twinkle twinkle little star …).

Twitch. I have some musical kids books that have this same bug. Twitch every time.

The original note logic goes like this:

  • note_beats[i]: how many beats to play the ith note
  • beat_time: how long for each beat
  • pause_time: short pause after each note so notes are audibly separated

So complete_note_time = (note_beats[i] * beat_time) + pause_time

This is fine when all notes have the same number of beats. However when each note is held for various beat counts, the pause time does not get extended so each note is no longer a full beat. Let’s do the easiest fix (although not the best):

Now complete_note_time  = (note_beats[i] * beat_time) + (note_beats[i] * pause_time)

No more twitch:

Here is the code with the fix noted on the pause line.

Smooth Spectrum for an RGB LED

I want to share this modification to the RGB tutorial since it was fun and looks nice. This RGB LED which came with the Adafruit ARDX kit is actually just a packaging of 3 LEDs sharing a common lead on one side. Controlling it is (almost) exactly the same as controlling 3 separate LEDs. It’s important to note that this particular RGB LED is common anode(+) which in the end means that unlike the other tutorials, 5V ==> Off; 0V ==> Max brightness.

Anyway here is some code that continuously and smoothly runs the LED through a (basically) non-repeating spectrum.  It’s not random but it will appear random to the human eye. Importantly, the steps are smooth so there are no sudden shifts in color or brightness.

Arduino – ARDX Kit Mounting Problems and Solutions

I have the Arduino Uno (mine is R3) and the ARDX kit as sold by I  ran into some problems mounting it.

No room for the nut next to the power jack.
No room for the nut next to the power jack.

If you follow the instructions with the kit, the bolts go up from under the board. However the nut barely has enough room to fit next to the power jack and definitely doesn’t have enough room to rotate. Adafruit suggested turning the bolt to tighten it – somebody else may be able to get that to work but I couldn’t due to having the second nut which also needs to be tightened.

Invert the bolt.

So you can invert the bolt – then the head fits nicely next to the power jack and it’s easy to tighten everything well.

Have to clip the excess bolt length beyond the rubber feet.
Snip snip.

Now you will have to snip the bolt to be shorter than the rubber feet. They are almost the same height so you may need to remove the nut before cutting.

Additionally, I had to snip the soldered power jack lead below the PCB because it was longer than the spacer nut. I guess it should probably be desoldered before snipping but I was too lazy and not confident enough for that.

Arduino ARDX Kit Fits after Mod
Mounted and ready.

Everything fits now. Hopefully adafruit will update the package for future orders. They never answered my question on the forum about updating it so I’m doubtful.