I just released a new version of the neorainbowduino “package”. It contains firmware for the Arduino and Rainbowduino and a new Processing library. Now you may control your rainbowduino’s from Processing!
Unfortunally you need to patch your arduino wire library:
utility/twi.h: #define TWI_FREQ 400000L (was 100000L)
#define TWI_BUFFER_LENGTH 98 (was 32)
wire.h: #define BUFFER_LENGTH 98 (was 32)
Those changes increase the I2C speed and increase to I2C buffer size.
Now upload the firmware to the rainbowduino(s) – do not forget to change the I2C address for each rainbowduino! Upload the Arduino firmware to you Arduino, wire up the whole stuff (check my last post about neorainbowduino how to connect the devices).
Finally install the processing library, make sure the I2C address is right and fire up an example project.
This is a screenshot of the neorainbowduino_simple example (note: two times the same image):
I implemented a gamma lookup table in the Processing library to improve the display quality. I found a good description of it’s requirement (source):
“The gamma table fixes the problem human eyes have correctly determining brightness of pulsed light. Even though PWM from 0 to 100% duty cycle is accurately
changing brightness in a linear way, the eye sees almost no difference between 75% and 100% brightness. So the gamma table uses something like a logarithmic
translation; the values will change very slowly at low brightness and very quickly at high brightness.”
I used a hsv image to control my gamma tab, and it looks now much better than without it. But the table is still not perfect – if you created a better table, don’t hesitate to contact me.
Step by step installation guide:
- get neorainbowduino firmware and library
- patch the wire library of your arduino package (see above)
- connect your arduino with rainbowduino (serial and i2c, RX,TX,GND,VCC 5v, Reset, SDA, SDL)
- upload firmware to rainbowduino(s)
- disconnect the serial connection between rainbowduino and arduino (rx and tx lines)
- upload firmware to arduino
- install processing library
- play with a provided sample source