CYZ_RGB: An alternative firmware for [http://thingm.com/products/blinkm BlinkM]
CYZ_RGB: An alternative firmware for BlinkM
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).
The original BlinkM firmware from ThingM is closed source due to licensing issues, so CYZ_RGB was written to provide an open-source implementation which can be shared and extended to support additional features.
The latest release implements all documented features of the original firmware with the exception of the built in light scripts which are sacrificed to make room for the extended features of CYZ_RGB.
In addition to the stock features of the BlinkM firmware, CYZ_RGB implements a 16-bit PWM routine and a logarithmic dimming table to provide smoother fades and more accurate color mixing. The normal BlinkM firmware controls the LED duty cycle on a linear curve, but the perceived brightness of the light output does not correspond to a linear scale. There is little difference between #808080 and #ffffff on a standard BlinkM although the expectation would be for the former color to be roughly half as bright as the latter. CYZ_RGB fixes this problem and fades are more linear.
Future work on CYZ_RGB may include expanding the I2C master-mode operation, adding support for 1Wire instead of I2C, supporting external timing/clocking for script synchronization, or supporting more advanced color transitions and fade easing. Of course, help is always appreciated!
If you decide to download and give it a try, you'll find a hex file that can be burned to your BlinkM, MaxM, or other similarly wired ATTiny44, ATTiny45, or ATTiny85 microcontroller. A binary including support for running the device in I2C master mode is not distributed in this release.
Browse the source code.
Download the latest binary release (beta1).
Subscribe to news feed to follow developement.
Get the sources with svn: svn checkout http://codalyze.googlecode.com/svn/cyz_rgb/trunk cyz_rgb
Use avrdude to flash the chip:
avrdude -pt45 -cavrispmkII -Pusb -b115200 -Uflash:w:slave.hex:a
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
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.
Matteo Caprari <matteo.caprari gmail.com>