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

blinkm

Dave MatthewsDave Matthews Posts: 93
edited 2014-05-26 08:26 in Propeller 1
I am preparing to have some fun with the propeller and some blinkm LED arrays. I searched the OBEX and the forum and found some snippets and such, enough I'm sure to get started. But just in case someone has done more work than is available in the OBEX, I thought I would ask. I am looking for any specific blinkm routines that I can experiment with to enjoy tinkering over this long weekend!

This is the device: http://thingm.com/products/blinkm/

Dave

Comments

  • RS_JimRS_Jim Posts: 1,766
    edited 2014-05-25 06:34
    Check out the propellar tutorial.there ae single cog and multicog examples blink a few times or forever.
    Jim
  • Dave MatthewsDave Matthews Posts: 93
    edited 2014-05-26 08:26
    Just got back to it, the BlinkM examples from 5 years ago work perfectly:
    CON
     _clkmode = xtal1 + pll16x
     _xinfreq = 5_000_000
     
     'Physical Inputs
     i2cSCL = 17 '<<<<<<set your actual pins here
     i2cSDA = 18
    OBJ
     i2c : "minimali2cdriver"
     
    PUB Start
     i2c.i2cstart(i2cSCL)
     TES 'run the i2c method below
     repeat 'stay alive
    
    PUB TES
     i2c.i2cstart(i2cSCL) 'start condition send SCL pin number
     i2c.i2cwrite(i2cSCL, %0001_0010) 'send address $09 plus write bit '0'
     i2c.i2cwrite(i2cSCL, "p") 'not sure here about this i2c driver sending 'f' as a ascii, may need to convert to hex first? someone comment
     i2c.i2cwrite(i2cSCL, $02)'value for red channel to $FF
     i2c.i2cwrite(i2cSCL, $00) 'value for blue channel to $00
     i2c.i2cwrite(i2cSCL, $00) 'value for green channel $00
     i2c.i2cstop(i2cSCL) 'stop condition
    

    The BlinkM is a very cool part, and I will now start writing objects to use the part in spin. Thanks to all those who provided the code snippets way back then!
    (The command characters such as 'p' for play and 'o' for stop are indeed entered as ascii.)
    Dave
Sign In or Register to comment.