Welcome to Synthiam!

Program robots using technologies created from industry experts. ARC is our free-to-use robot programming software that makes features like vision recognition, navigation and artificial intelligence easy.

Get Started
Asked — Edited

Blinkm

This is how you use the blinkmk in ez-builder.

The address of the blinkm is default 0x09 (that's 7 bit). you need to turn that number into an 8 bit number to write, that's 0x12. The LSB of the i2c address is reserved for the direction of data. A 1 in the LSB means READ, and a 0 in LSB means WRITE.

If you look at the datasheet (google search blinkm datasheet), you'll see commands.

This will turn a blinkm to the color red:

Code:


I2CStart()
I2CWrite(0x12, 0x6e, 0xff, 0x00, 0x00)
I2CStop()


This is how you turn a blinkm to the color green

Code:


I2CStart()
I2CWrite(0x12, 0x6e, 0x00, 0xff, 0x00)
I2CStop()


This is how you turn a blinkm to the color blue

Code:


I2CStart()
I2CWrite(0x12, 0x6e, 0x00, 0x00, 0xff)
I2CStop()


note:
hex is NOT case sensitive. you can use upper or lower case, it doesn't matter. 0xFF also equals 0xff. However, 0XFF is not hex. The X is always lower case in HEX. Google will help you understand why.

You may also not use hex and use characters instead. Like most programming languages, characters are defined with single quotes ' and strings are defined with double quotes ". You can use the letter 'n' instead of 0x6e in this peice of code...

Code:


I2CStart()
I2CWrite(0x12, 'n', 0x00, 0x00, 0xff)
I2CStop()

AI Support Bot
Related Content
Synthiam
Based on your post activity, we found some content that may be interesting to you. Explore these other tutorials and community conversations.
PRO
Synthiam
#2  
Hello Nial, you can either use the BlinkM control under the i2c menu option (Add Control -> i2c -> BlinkM) and manually contorl the blinkm

For real-time control, you the above demonstrates how to write a script to do that.

1) Add a SCRIPT control (Add Control -> Scripting -> Script)

2) Press Configure

3) Copy in my example code

4) Press Save

5) Press START on the script control (assuming you are already connected to the ez-b)
#3  
Ok thanks dj I'll try it out tonight much appreciation.
#4  
how do i erase the original program from the blink m i have the original running and then the scrpit play and it goes bact to the original demo program on the blink m
PRO
Synthiam
#5  
Check the blinkM datasheet. Somewhere in there it says a command to "Stop" the script.