A few of you may have seen me walking around the after party with a blindingly bright flashy demo running on my badge. More than a few people stopped me to ask me how I managed to do that. Here is a very brief tutorial on how to get the Adafruit NeoPixel "strandtest" demo up and running on your badge. Be aware, if you continue to run the badge on the stock CR2032 lithium coin cells, this sketch will kill your batteries pretty quick. That's why I opted to install the supercaps, as mentioned in the project details page.
- First things first, go get and install the Arduino IDE from arduino.cc. I've tried version 1.6.4 on both a WIndows 7 desktop and an Ubuntu 14.04 laptop for this process.
- Then go get the Adafruit NeoPixel library from github (click the "Download ZIP" button on the left hand side of the page)
- Extract the contents of the ZIP, and dump the resulting directory into your Arduino libraries directory (Note that you may need to rename the Adafruit_NeoPixel-master directory to just "Adafruit_NeoPixel" ). A great guide for doing this can be found here.
- Open the Arduino IDE, click File > Examples > Adafruit Neopixel > strandtest. This should open a new window with the example code we will use.
- Edit the 3rd line to change "#define PIN 6" to say "#define PIN 4". The LEDs are connected to pin 4 of the Atmega32u4 on the Thotcon 0x6 badge. If you are using a different arduino board, it may be on another pin.
- Plug your badge into your computer with a micro USB cable. If your coin cells are dead (most likely at this point), the badge will switch over to being powered by the USB port. Don't forget to take those dead coin cells out of the badge so they don't start corroding and damage your badge.
- Depending on what OS you are using, you may need to install the Arduino Leonardo USB drivers before your badge is recognized. Take a look at this guide.
- Once your badge shows up as a usb serial device, you are ready to upload the example code to your badge.
- Click Tools > Board > Arduino Leonardo
- Click Tools > Port > COMx (COMx on windows, /dev/ttyACMx on Linux, /dev/tty.usbmodemXXXX on OSX)
- Click File > Upload
- If all goes well, the black log box at the bottom should display some messages, and eventually say "Done uploading", and your badge should spring to life, flashing lots of bright colorful patterns on its 6 forward facing LEDs.
- Feel free to edit the example code to make new patterns, or find other Neopixel examples online.
- Welcome to the world of microcontrollers! It's a lot of fun, there are a lot of great resources online, and there are a limitless number of cool things you can build. Don't forget to share your experiences with others if you build something cool!
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.