Clever Code with 2D arrays

With a built and tested pair of custom Neopixel Shades, we can now move on to what makes these shades tick, the code! This program is a great use of what's called a two dimensional array, or essentially a grid of datatypes that can be accessed by row and column. Because the Neopixels are connected in a chain, if we want to control the leds from left to right on the shades, or control them by row and column as they appear on the front of the shades, we can't just count up from 0 as it would zig-zag. The array solves this by putting the addresses of the leds into a grid as they appear on the shades, so each can be addressed and controlled in a logical way. Read more here if you're interested.

Programming the Shades

Ok, now that we've nerded out a bit, we can move on to finally giving life to your shades! If your IDE is set up, your libraries are installed properly, and you've found somewhere to sit down, prepare yourself to witness the awesomeness of your new pair of Bluefruit controlled Macetech Neopixel shades! Plug in your shades, and upload the project code in the same way you tested the LEDs and bluetooth. If your upload is a success, read on to learn how to control your shades!

You did it!

Congrats on building your own pair of Ada-hacked Macetech RGB LED shades!

Powering your Shades

Those 68 Neopixels on your new shades need a lot of juice, so the best way to power them as you wear them out and about is a USB power bank like this one and a ~3-4 ft micro USB cable. At this project's comfortable brightness, the shades run at about ~100ma, which should last roughly 20+ hours!

Be careful! Some power banks can't handle the sharp current draw of the shades and will cause glitchy issues!

Bluefruit LE Connect App

Now they're built and programmed, download the Adafruit Bluefruit LE Connect app for iPhone or Android to get controlling them!

Controlling the Shades

1. Open the app, and select the shades in the device list

2. Next, pick the "controller" option


Color Picker

The first mode to control the shades is the Bluefruit LE Connect's color picker. Select an RGB color value from the wheel, and press "send." The color will now zig-zag across the shades! To turn them off, slide the darkness bar to black and press send again.


The second mode to control the shades is a selection of four animations triggered by the "control pad" option of the "controller" menu, below "color picker." 

The button functions are as follows:

  1. Single color fading rainbow, all LEDS
  2. Full spectrum rainbow flowing from left to right
  3. Full spectrum rainbow VU meter L-R
  4. Single color fading rainbow VU graph L-R

Guide Complete!

And that's it! Congrats on your custom pair of hacker edition Macetech RGB LED shades! Show us your pair on twitter @adafruit, and rule the dance floor, or your work bench, that's cool too, it's up to you!

This guide was first published on Mar 12, 2016. It was last updated on Mar 12, 2016.

This page (Software and Bluetooth Control) was last updated on Feb 26, 2016.

Text editor powered by tinymce.