My favorites | Sign in
Project Logo
                
Search
for
Updated Sep 12, 2008 by matteo.caprari
CyzRgb  
CYZ_RGB: An alternative firmware for [http://thingm.com/products/blinkm BlinkM]

CYZ_RGB: An alternative firmware for BlinkM

Version Alpha 2 - Feature complete

BlinkM is a Smart LED produced by ThingM:

BlinkM is a “Smart LED”, a networkable and programmable full-color RGB LED for hobbyists, industrial designers, prototypers, and experimenters.

Just connect it to an I2C bus and start sending commands like "show rgb color" or "fade to hsv value" and so on and so forth (it does much more; see the human-readable data sheet).

A bit of explanation: I liked the idea to do a few more things with the leds and decided to modify the firmware. The original firmware is actually closed source (due to legal issues) so I had to start writing a new one from scratch.

The latest release implements all the features of the original firmware. The firmware has been slightly tested at a functional level, but has no unit tests.

I usually write loads of tests, possibly before the actual code; this time I was wandering in a completely new area and I knew most of the code was going to be higly disposable. Now that all hurdles have been surpassed, the refactoring stage will go hand-to-hand with writing a thorough test suite. Wish me good luck.

The new firmware has two interesting additional features in the works: the ability to act as a master on the I2C bus (it works) and support for dallas 1-wire protocol (not yet), to leave one pin free for your creativity.

Download

If you decide to download and give it a try, you'll find slave.hex and master.hex: the first is the actual blinkm firmware replacement, the other is the experimental master. You can flash the files on two different blinkms, connect them the to the same i2c bus and watch they change color together.

Browse the source code.

Download the latest binary release (alpha2).

Subscribe to news feed to follow developement.

Get the sources with svn: svn checkout http://codalyze.googlecode.com/svn/cyz_rgb/trunk cyz_rgb

Install

Use avrdude to flash the chip:

avrdude -pt45 -cavrispmkII -Pusb -b115200 -Uflash:w:slave.hex:a 

Interested? I need help

I'd like to hear from you. If you have any patch to submit it will be welcome.

Please not that my experience in C is very limited. And it approaches zero when it comes to microcontroller programming. So, if you are any good at it, please be patient and expect the worse... i'm a java programmer ;). When you stop feeling sick after reading the code, well, drop me a line

Implemented features

command namecmd charcmd byte# args# ret valsformatimplemented
Go to RGB Color Nown0x6e30{‘n’,R,G,B}yes
Fade to RGB Colorc0x6330{‘c’,R,G,B}yes
Fade to HSB Colorh0x6830{‘h’,H,S,B}yes
Fade to Random RGB ColorC0x4330{‘C’,R,G,B}yes
Fade to Random HSB ColorH0x4830{‘H’,H,S,B}yes
Play Light Scriptp0x7030{‘p’,n,r,p}yes
Stop Scripto0x6f00{‘o’}yes
Set Fade Speedf0x6610{‘f’,f}yes
Set Time Adjustt0x7410{‘t’,t}yes
Get Current RGB Colorg0x6703{‘g’}yes
Write Script LineW0x5770{‘W’,n,p,d,c,a1,a2,a3}yes2
Read Script LineR0x5225{‘R’,n,p}yes1
Set Script Length & RepeatsL0x4c30{‘L’,n,l,r}yes
Set BlinkM AddressA0x4140{‘A’,a...}yes
Get BlinkM Addressa0x6101{‘a’}yes
Get BlinkM Firmware VersionZ0x5a01{‘z’}yes4
Set Startup ParametersB0x4250{‘B’,m,n,r,f,t}yes
Pre-defined light scriptsyes 5

x Only available in subversion head.

2 Max 10 lines. Only valid commands are go and fade to RGB. Script number 'n' is ignored, can only write script 0

4 current head version returns 0.1

5 only script 1. no predenfined script 0.

Goals for next release

Matteo Caprari <matteo.caprari gmail.com>


Comment by i001962, Sep 16, 2008

Matteo, thanks for kicking this project off. AVR programming is new to me but I think what you are doing will be of use to me on a hobbyist project that I'm working on. The little I've figured out thus far led me to believe I needed BlinkM to be a master on the bus. Thanks again for sharing your work.

Kevin

Comment by ryanjrose, Jul 10, 2009

Any updates on this project?


Sign in to add a comment
Hosted by Google Code