Shop OBEX P1 Docs P2 Docs Learn Events
BlinkM — Parallax Forums

BlinkM

servelloservello Posts: 113
edited 2008-07-15 14:11 in BASIC Stamp
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
477 x 280 - 18K

Comments

  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-05-08 14:45
    Dominic,
    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
  • servelloservello Posts: 113
    edited 2008-05-08 19:02
    Thanks for the reply, Rusty.

    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
  • JimKJimK Posts: 21
    edited 2008-05-09 01:25
    Hi Rusty,

    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
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-05-09 12:05
    The command codes are given in the datasheet, starting at page 8, 9.

    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.
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-05-10 17:45
    servello said...
    Thanks for the reply, Rusty.

    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.
    Yes, I was rather disappointed with that as well. Still, with a BS2p, programming was rather trivial.

    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
  • servelloservello Posts: 113
    edited 2008-05-11 05:41
    Hi Rusty,

    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
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-07-12 07:43
    FWIW... I know it's been a while and hopefully Dominic has gotten a few BlinkM's
    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
  • servelloservello Posts: 113
    edited 2008-07-13 00:00
    Hiya Fe2o3Fish,

    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
  • Fe2o3FishFe2o3Fish Posts: 170
    edited 2008-07-14 04:23
    Dominic,
    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
  • servelloservello Posts: 113
    edited 2008-07-14 18:54
    Rusty,

    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
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-14 19:09
    I'm guessing you didn't have a 220 ohm resistor in the data line between the BS2 and the BlinkM?

    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.
  • servelloservello Posts: 113
    edited 2008-07-14 21:11
    allanlane5,

    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
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-07-15 14:11
    Yes, and DOES NOT HAVE any 220 ohm resistors IN SERIES (in-line) between the BS2 and the BlinkM. The 4.7K ohm pull-up resistors implies to me that the BlinkM does not "drive-high" the signal. However, it does "pull-low" the signal.

    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.
Sign In or Register to comment.