This is how you use the blinkmk in ARC .
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:
I2CStart()
I2CWrite(0x12, 0x6e, 0xff, 0x00, 0x00)
I2CStop()
This is how you turn a blinkm to the color green
I2CStart()
I2CWrite(0x12, 0x6e, 0x00, 0xff, 0x00)
I2CStop()
This is how you turn a blinkm to the color blue
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...
I2CStart()
I2CWrite(0x12, 'n', 0x00, 0x00, 0xff)
I2CStop()
where do i put this information in the ARC screen? cool
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.
Add a SCRIPT control (Add Control -> Scripting -> Script)
Press Configure
Copy in my example code
Press Save
Press START on the script control (assuming you are already connected to the ez-b)
Ok thanks dj I'll try it out tonight much appreciation.
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
Check the blinkM datasheet. Somewhere in there it says a command to "Stop" the script.