Nov 102013

[EDIT] Here is a link to an update of these effects made by Stefan Mayer designed to work with the OctoWS2811 LED Library. Thanks a lot Stefan, great work!

[EDIT] I’m planning to clean up the Android control app source and put it on github, but in the meantime here’s the code.

[EDIT] If you end up using this code for a project please send me a link/pics/video! I love seeing what people do with this! If you like I’ll post a link to your project on the FastSPI FX – User Coolness post. Also make sure to thank Daniel Garcia (the genius dev of the FastSPI library) on the G+ FastSPI Community.

Here is an update to the Arduino FastSPI2 FX demo code (v0.51). I’m also introducing an Android Bluetooth Control App and a Chrome Extension.

I’ll continue to work on improving these programs but I think I have them to a point where it might be useful to some people- so here they are!

Here is the Arduino Sketch (v0.51)

Here is the Android App on the Google Play Store (v0.1a)

Here is the Chrome LED Controller Extension (v0.1)

— — — SETUP / NOTES — — —

– This version uses the Software Serial library and FastSPI2 library. Also the default serial speed is now 57600.
– The following is a breadboard layout and schematic for setting up a JY-MCU Bluetooth chip with an Arduino (Duemilenove or Nano) to drive a strip of addressable LEDs. This should work with any LED strip that is supported by FastSPI2 RC4 and later.

– To control LED strips via the Android app you’ll have to pair the JY-MCU module with your smartphone/tablet in the Bluetooth/Wireless settings. The PIN for these modules is usually 1234.

– To load the extension, unrar the file to a directory. Then in Chrome go to Settings>Extensions>Load Unpacked Extension. Then select the directory. Then you can launch it from there.
– This extension has been tested on Ubuntu 12.04 and WindowsXP. For Windows you’ll have to install the USB Serial drivers, but the automatic driver search seems to work fine for this.

— — —

If you find this really useful, please consider donating a little to the cause. Thanks!

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq


Oct 152013

I had a little trouble finding references to how to setup multiple strips with FastSPI2, so I thought I’d post this.

You just use an offset value like in this example:

LEDS.addLeds<WS2801, 7, 9,   RGB>(leds, 43);       //<---Strip1 - WS2801 - 43 LEDs
LEDS.addLeds<WS2801, 11, 13, RGB>(leds, 43, 12);   //<---Strip2 - WS2801 - 12 LEDs
LEDS.addLeds<WS2811, 5,      GRB>(leds, 55, 16);   //<---Strip3 - WS2811 - 16 LEDs

In the additional strips the first integer passed becomes the offset value and the second is the number of LEDs in the strip.


Sep 212013

[EDIT] Please check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control Extension.

[EDIT] Revised once again, and made a python GUI. See this new post.

This is a revision of the original FastSPI LED Effects Examples I wrote awhile back.


I’ve gotten some very positive responses for these examples so I figured I should update them to be a little less clunky (the operative term here being ‘less’, they’re still quite clunky) This revision will work with RC3 of the FastSPI2 Library.

These are little LED displays I made, one is a circular back-light and the other a wave shape with a little diffusion in front. Both are Arduino powered of course. I just ran the ‘demo mode’ on both and tried to start at the same time so they’re not in sync or anything. Just thought I’d show them on a couple of different configurations for the heck of it.

If you have any issues getting this to work please check through the comments on the original post page first. A lot of people have posted very helpful comments about their experience using the code that might help you on your way. And of course feel free to post your issue if you can’t find a solution- I’ll do what I can to help.

Most significantly I’ve removed the need for the SerialCommand library and the really hacky HSV->RGB conversion function in favor of the native FastSPI2 conversion which is much faster and cleaner and supports ‘rainbow’ and ‘spectrum’ modes (though for these examples I just stuck to ‘rainbow’.)

I also added one example of a ‘native’ FastSPI effect; the fill_rainbow function (new_rainbow_loop – mode 88). This is similar to the ‘rainbow_loop’ function except that is fades the colors into one another much better. I’ll add more ‘native’ effects functions like fades to the code later because they are much faster and have nicer aesthetic qualities than mine.

Change modes the same way as in the previous code, enter ‘m’ and then an integer for the mode number (listed in code). Also make sure you send a NEWLINE character. Mode 888 is ‘demo mode’ which cycles through all the modes, but this tends to block the next serial command.

Also you can change the maximum brightness with ‘b’ and then an integer from 0-255. By default it’s set to 64, about 1/4 brightness.

Here is the code.

[EDIT] I recently fixed a few issues where I messed up the HSV conversion and I utilized a few more of the FastSPI2 functions. Also finally started giving the code a version number. This one’s v0.3, I’ll do better with that in the future.

Most notably I added the ability to adjust parameters of many of the effects via serial commands. The following commands are now accepted:

(d)elay 0-INF | d50 | Adjusts the delay value, effects run faster or slower.

(s)tep 0-INF | s5 | Adjusts the steps between colors, mostly for rainbow effects.

(h)hue 0-255 | h180 | Adjusts the hue of effect, mostly for one and two color effects.

sa(t)uration 0-255 | s50 | Adjusts the saturation of effect, mostly for one and two color effects.

Here is the code. (v0.3)

If you have any requests feel free to ask, I’ll see what I can do! I’m more-or-less open for business if you have anything in particular you need tackled. And if you find these very useful, please consider donating a little via. paypal, I’d really appreciate it :)

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq

Apr 102013

I would like to introduce:

Stanley Tweedle – Captain of the Lexx.
Formerly Security Guard Class 4 for His Divine Shadow, and Assistant Deputy Backup Courier for the Austral B Heretics.


I have a new project that will have to borrow time from my robot stuff for a bit, so I wanted to go ahead and post what
I’ve done so far, mostly for my own reference when I go to pick this up again.

(1) Arduino Nano
(2) 9g Continuous Rotation Hobby Servo
(1) Ultrasonic Rangefinder
(1) 6DOF Acc/Gyro
(1) USB 5V Battery
(3) WS2811 LEDs
(1) Bluetooth chip

Tweedle is complete hardware wise, but I have a little more coding to do before I’m satisfied with his brains. I ran out
of space in the Nano for anything other than input/output so all the control is done from a remote PC via python over
bluetooth/serial. I also made a wiimote script to control him manually. His brains is just basic obstacle avoidance right
now, still trying to see how much nav/odom info I can derive from a 6DOF sensor. Dead reckoning would result in massive
error accumulation, so for right now it just tells him orientation.
Anyway I’m pretty happy with how he’s turned out so far and he’s been a lot of fun. I’m usually not concerned with
aesthetics of these kind of things but I think he’s kinda cute.

This probably won’t help anyone because if you’re deep enough in your a project to understand my code- you’re deep enough
to write it yourself probably faster than it would take to adapt mine to your project… but here is is anyway.

Tweedle Arduino Sketch
Python Ncurses Control Program
Python WiiMote Teleop Program (NOT WORKING)

And here’s some more pics of the wiring…

z2013-09-14_11-34-50_778 z2013-09-14_11-35-19_156 z2013-09-14_11-35-28_663 z2013-09-14_11-36-24_726 z2013-09-14_11-36-40_360


Dec 172012

So here’s my review of the Hexbright – Open Source Flashlight

• It’s insanely bright. You really have no idea. Seriously impressive.
• Good and solid, yeah. Perfect fistful of flashlight but still goes in the pocket. It’s not a mace like a big maglight but you would not want to be cranked upside the head with this. You could drop it on a bare foot without fracturing anything, but you’d remember not to do it again.
• Battery life seems good. Haven’t stress tested but no complaints yet.
• Simple, rugged construction. Twist off end pulls all the guts out of the aluminum and you’ve got access to the board, battery and LED, no problem.
• Nice beam! The single LED and lens give a really unexpectedly beautiful spread. A little hot in the center but it is a flashlight…
• Color temperature – 5380K – just shy of daylight. Meter also showed a tiny green spike in high mode but not noticeable with the eye. Easily color corrected with a little gel.
• Programming – easy to get started (but to be fair I’m pretty experienced with Arduino). Just had to load the board file and I was off and running. Loaded a couple of examples and pretty soon I was adding code the factory firmware. This is where having a ‘programmable’ flashlight is really cool. So for instance I didn’t like the fact that I had do cycle from LOW-MED-HIGH to turn the light off. So I added some code to where a long press after LOW or MED will turn the light off. Lots more possibilities here.
• Overalll: It’s an amazing flashlight and it’s open-source! Get one!
Canon EOS 400D
1/4 s | f/4.0 | 28mm | ISO 400 | Daylight (5200K)

Here’s my hack at the firmware. Adds an ‘ULTRA-LOW’ mode, and a ‘DAZZLE’ mode. Also long-press will turn the light off from any mode.

modified hexbright firmware

Oct 262012

[EDIT] Please check out the newest version of the FX Code (v0.51) with Android Bluetooth Control App and Chrome Control Extension.

This code has been revised and I made a new post about it – please see updated post HERE

[EDIT] If you end up using this code for a project please send me a link/pics/video! I love seeing what people do with this! If you like I’ll post a link to your project on the FastSPI FX – User Coolness post. Also make sure to thank Daniel Garcia (the genius dev of the FastSPI library) on the G+ FastSPI Community.

[EDIT] If you have any requests for certain types of effects I’d be happy to look into it. Just let me know what you’re looking to do and I’ll take a swing.

If you find this code very useful please consider donating a little via paypal. I’m having some ‘financial instabilities’ right now and any little bit would help. And if you need a certain effect coded, a donation would certainly obligate me to get that working for you! Sorry for this, it sort of feels like panhandling and the real credit should go to the library creator, but we do what we have to… Thanks for understanding.

I’m also grateful for bitcoin donations to: 1K5Yy77ejes2FZrHBG5fns3QAicnwZcduq


Some LED effects I’ve written for Arduino and FastSPI library.

Mostly written for a circle of LEDs but plenty useful for any configuration.
Code available here… the code

***Here is an update to the FastSPI_2_RC1 – the code

Used WS2811 strip, but have also tested with WS2801.

I’ve only tested this on the duemilanove and nano boards. It’s looking like this does not work on the UNO and I’m not sure about the Leonardo or the new Due.

Several people have indicated problems finding the SerialCommand library – so here’s the version I’m using SerialCommand

Here’s where I found it. Thanks to this guy for the library- Steven Cogswell commands/


Aug 262012

This is UgBot: The ugliest electronic mess since Superman III.

UgBot technically isn’t a robot, just a remote controlled thing. It started as a test for my next robot project (to be called Dominar Rygel XVI)

I just had to work through a few simple ideas before I started on a more sophisticated platform and this is what I ended up with.

UgBot’s hardware is:
(1) Arduino Nano
(1) Bluetooth TTL Module
(2) Micro Servos (modified to continuous rotation)
(1) Breadboard (sawed in half)
(1) Battery Pack (4)AAA
Poweraide and Coke Caps for wheels
Lots of jumpers

and the software is:
-Arduino sketch with CmdMessenger, Servo, and SoftwareSerial libraries (software serial is so I don’t have to pull the TX/RX pins for debugging. It’s a big help)
-Android app which I basically stole from this guy Eirik Taylor’s project. I changed the UI and the serial commands but the rest is pretty much his code. I’m so lazy I didn’t even change the name so the app is still called BluCar from his project.

I absolve myself of the theft since he admits that he took most of the code from the BlueTooth Chat example in the Android SDK.

Here’s the Android and Arduino Code

Here’s updated android code (w/ multitouch enabled) Code

Aug 202012

I guess I’ve been using Blender for so much for so long that I tend to look for ‘Blender-like’ controls in a/v projects. So inevitably when I started working with LED strips I immediately tried to weasel out of having to think through functions and loops in arduino code to create effects I could do intuitively in Blender.

So after a few bad UI attempts I thought – hey, wish I could just design a light sequence in Blender and run it with ALT-A. So that’s what I did.

On the arduino side it’s using the FastSPI and CmdMessenger libraries for LED and serial communications.

The Blender script just reads the diffuse color in r-g-b from each LED objects material and spits it out to the USB port. Getting the pyserial library hooked up in Blender wasn’t a breeze but the “sys.path.append” line should help anyone having the same issues I did.

Here’s the arduino code and Blender file

(Using Arduino Duemilanove 328 and LED strip with WS2801 chips)


Blendernation article (Thanks Bart!)

I forgot to mention I’m using Ubuntu so the sys.path.append thing wont work for windows, you’ll have to find the pyserial library solution elsewhere (there’s plenty of reference out there)

Also – the script runs on each frame change. Here’s how that works (WARNING: kinda hacky)

QUESTION: For any API guru’s out there – currently this script opens and closes the serial port on each framechange. I know this is radically inefficient. Any ideas on how to keep the serial port open persistently but to close it when blender closes?





Aug 162012

Here’s an Arduino LED backlighted sign I made.

Electronics are:
(1) Arduino Nano – $16
(1) Bluetooth TTL- $10
(23) Addressable LED Strip (SMD5050/WS2801) – $20

Then some foamcore, paint, and hot glue.

I’m using a android bluetooth terminal program to send serial commands to the arduino. Right now the program just calls ‘Modes’, which are different effects I hacked together in the arduino IDE. Later I’ll write a more versatile program so you can more directly control the LED’s with an Android app or something.

FYI – The Q is for Quixote Studios.