I had posted about a year ago, about trying to script the blinkM to bend to my will. I have need to get ahold of this little guy but running into the exact same trouble as before. The BlinkM come preloaded with about 18 scripts. The default script plays as soon as it receives power. Now if I start the blinkm controller located in the i2c folder the interface comes up. The only way to control the blinkM is to hit the stop script., which it does and glows whatever color it was on at the time of hitting that button. With the sliders i can control the color of the LED. Now I open up a script and use the i2cwrite, to tell it to goto a color, i.e I2CWrite(0, 0x09, 178,102,255). I can see the script being sent on the blue led on the ezb3, so I know its sending, but the blink, just remains the same color as when I pressed the stop script button on the blinkm control board. Now why not just use the control panel? Because I want to be able to changes the colors over time by calling scripts etc.
Any help to sort this out would be appreciated. If need be I can upload a video of the set up and my issue.
BTW the manual still has the Sendi2c as the command, instead of "write" and needs to be updated.
Upgrade to ARC Pro
Your robot can be more than a simple automated machine with the power of ARC Pro!
Pushed for time right now but hope that's of some use to you. I'll revisit this when I get chance if you need more help.
Note: The above is old syntax, put the A, n, c etc. in quotes to meet new syntax. i.e. I2CWrite(0,0x09,"n",0x00,0x00,0xff) or I2CWrite(0,0x09,"c",0x00,0x00,0xff)
Looking a bit closer, it is likely to be your I2CWrite commands which are the issue. If you want me to check it out feel free to post it (or email it if you want to keep it private)
The BlinkM Datasheet is really well laid out and should explain everything a bit better than I can (see page 17) but the basics are;
n = Go to RGB colour now
c = fade to RGB colour
h = fade to HSB colour
C = fade to random RGB colour
H = fade to random HSB colour
p = play light script
o = stop script
f = set fade speed
t = set time adjust
g = get RGB current colour
W = write script line
R = read script line
L = set script length and repeats
A = set address
a = get address
Z = get firmware version
B = set startup parameters
Note: These are Case Sensitive
So, for instance, to fade to red, to green then to blue the code would be something like this,
Or to flash red/blue like police lights the code would be something like;
The main commands are c (fade to) and n (go to now) followed by the hex for the shade of red, hex for the shade of green then hex for the shade of blue.
Since scripting in ARC is pretty simple I've not needed to use the built in script functions of the BlinkM, I just have a bunch of scripts which run the I2CWrite commands for the patterns.
As for dec to hex conversion, windows calculator can do that. I do it mentally (I have been using hex for nearly 20 years now) but set Windows calculator to programmer mode (Alt & 2 or view programmer), make sure it's on dec, type in the number i.e. 138, hit the hex radio button and it will give you the hex code (8A in this case).
Or google dec to hex and I expect millions of online calculators will pop up.