Hi,
I have an Aduino 2009 and a BlinkM MaxM LED.
I have read in the datasheet about how to set up I2C communication and make up commands. I made this script as example to blink the LED from white to violet:
#include "Wire.h"
void setup()
{
Serial.begin(9600);
Wire.begin(); // set up I2C
Wire.beginTransmission(0x09); // join I2C, talk to BlinkM 0x09
Wire.send('c'); // 'c' == fade to color
Wire.send(0xff); // value for red channel
Wire.send(0xff); // value for green channel
Wire.send(0xff); // value for blue channel
Wire.endTransmission(); // leave I2C bus
}
void loop()
{
Wire.beginTransmission(0x09); // join I2C, talk to BlinkM 0x09
Wire.send('c'); // 'c' == fade to color
Wire.send(0xff); // value for red channel
Wire.send(0xff); // value for green channel
Wire.send(0xff); // value for blue channel
Wire.endTransmission(); // leave I2C bus
Serial.println("white");
delay(6000);
Wire.beginTransmission(0x09); // join I2C, talk to BlinkM 0x09
Wire.send('c'); // 'c' == fade to color
Wire.send(0x88); // value for red channel
Wire.send(0x00); // value for green channel
Wire.send(0xff); // value for blue channel
Wire.endTransmission(); // leave I2C bus
Serial.println("violet");
delay(6000);
}
For now am powering ther MaxM from Arduino board from +5V and GND pins while SDA is from Analog 4 and SCL Analog 5.
The MaxM turns on and starts its default changing sequence through colors but doesn't respond to my commands. I tried the other I2C addresses as well, including 0x00 (general).
While serial output correctly shows 'white' or 'violet' every 6 seconds there is no change at all from the LED, just the default sequence.
Are you sure you have the data and clock lines connected correctly to the BlinkM itself? If not, it would never receive the commands and only display its default script.
I would suggest downloading the example programs from the ThingM website, here. Then try the BlinkMTester sketch.
Hi,
thank you for the suggestions. I checked the connections and all seems fine including
d = sda => analog in 4
c = scl => analog in 5
Right now I have the MaxM on a breadboard with wires connecting it to the arduino pins. I tried changing breadboard and wires but same effect.
I tried the BlinkMTester sketch and the output in serial window is a bunch of unreadable chars.
The only effect was that MaxM stopped the default color cycle (it still does cycle if unplugged from arduino and master board is powered by battery, so default scheme is still unchanged but that's no problem).
I also checked Analog pins 4 & 5 using a sketch with an ultrasonic sensor. They work fine.
The gibberish characters in the serial monitor window are from an incorrect baud rate. Make sure that the rate in the call to Serial.begin (9600) matches what you have set in the selector for the serial window, then close and reopen the serial monitor window.
If you get that going, you should get more diagnostic info.