BlinkM
servello
Posts: 113
Greetings,
Would anyone here happen to have any BlinkM sample code for use with the BS2?
I have attached an image·that is taken straight from the BlinkM datasheet. It shows a method of connecting the BlinkM to a BS2.
Thanks.
-Dominic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
Would anyone here happen to have any BlinkM sample code for use with the BS2?
I have attached an image·that is taken straight from the BlinkM datasheet. It shows a method of connecting the BlinkM to a BS2.
Thanks.
-Dominic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
Comments
You communicate with the BlinkM via I2C. The basic BS2 doesn't support I2C directly -- use any of the BS2p's for that.
The BS2 can communicate over I2C but you need to supply that functionality in PBasic. Here are some routines that come
from Matrix Orbital that do that: http://www.matrixorbital.ca/appnotes/i2c/I2C_BS
I have some test programs that control a BlinkM but they are for the BS2p. I can post them if you or anyone else is
interested.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock <=> AE5AE
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
I will be looking into your suggestion to see what I can come up with. Still, it's rather odd that the BlinkM datasheet includes a diagram for hooking up to a BS2 without including some code to accompany it.
Best,
Dominic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
I do have a BS2P and was thinking of trying this device but did not know where to start.· If you could upload your sample code it would be much appreciated.· Thanks
It'll be tough going, not impossible,·with a BS2 by·"bit-banging" the I2C and there·are Nuts & Volts articles on how to·manage (N&V #s 79, 85, 115.)
I think that a BS2p, -pe, px would be better because they have the I2COUT and I2CIN commands, which would be very handy for this device.
I've attached some BS2p code for JimK to experiment with as well.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock <=> AE5AE
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
I have to wait for the BlikM's to come back in stock (hopefully soon since the 'Maker Fair' is done).
I've been waiting a few months already, and I'm anxious to·check it out -·(I·have an Arduino I can use until some BS2 code shows up).
Anyway, If anyone reading this thread does eventually acquire BS2 code, please let us know.
Best,
Dominic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
for himself.
On thingm.com/products/blinkm there is a link for some example code
"EXAMPLE CODE (15kB ZIP)" on the right-hand side of the page.
This contains code for JPO-BS2 (Just Plain Ol' BS2). It includes routines
to bit-bang the I2C protocol to the BlinkM device.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock <=> AE5AE
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
Post Edited (Fe2o3Fish) : 7/12/2008 7:49:08 AM GMT
I did indeed get a couple of BlinkM's. What a really great item. I have not, as yet tried the BS2 code. I had been given some code for the BS2 to try out, and it fried the BlinkM. The guys sent me a replacement and I sent them the dead one. I was hoping to find out what happened. But no word yet.
Notice: The code supplied in the referrenced zip file is NOT the same code that killed my BlinkM.
Best,
Dominic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
I have a hard time believing code killed a BlinkM unless there's some sort
of bug in the BlinkM firmware that caused it to change it's flash memory. Dunno...
If you hear back from the BlinkM guys about what went wrong, please post the
diagnosis. Thanks!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rusty-
--
Rusty Haddock <=> AE5AE
**Out yonder in the Van Alstyne (TX) Metropolitan Area**
Microsoft is to software what McDonalds is to gourmet cooking
The BlinkM worked fine in standalone mode (just adding power to it). It also worked fine hooked up to my Arduino (it ran the sequences I programmed it to run). Then I loaded the BS2 code and it ran fine for the first few commands. Then it just went green and stayed that way. I tried it in standalone mode again, and still it would only remain green. I tried it with my Arduino again, and would not accept any change. It remained green no matter what I programmed. I went back to the BS2 code to see what I could do, but nothing would change it's current state of static green.
Common sense tells me that it was something in the BS2 code that screwed up the BlinkM. As you suggest, it was probably the Flash memory that was affected. It's been a while now, and I've not yet heard back from the BlinkM team. If, however they do let me know what went wrong, I will be sure to post that info here.
-Dominic
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
This sounds like a "pin burned out because both were outputs at the same time while one was 'HIGH' and one was LOW." That's about the only hardware-based scenario that the BS2 differs from other processor chips. And a 220 ohm resistor in series between the two I/O pins would prevent damage in this case.
I have shown in my original post that I used the diagram supplied by the BlinkM Team which includes two 4.7k resistors.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- It's just a scratch, but it's a nasty scratch
If, in the protocol, at any time the BlinkM pulls the signal low, WHILE the BS2 is driving the signal high, some I/O pin is going to burn out. UNLESS there's a 220 ohm resistor between the two pins to prevent this.
That was the only hardware/software scenario I could figure out that could actually damage the BlinkM.