Author Topic: problems trying to drive an I2C-controlled "BlinkM" LED module  (Read 4347 times)

blave

  • Newbie
  • *
  • Posts: 4
problems trying to drive an I2C-controlled "BlinkM" LED module
« on: December 06, 2014, 07:57:22 pm »
I thought I had posted about this a few days ago but apparently I forgot to hit "send".

I have a BlinkM module: http://thingm.com/products/blinkm/

When I attempt to compile one of the demo programs ("BlinkMTester"), I get the following when the DS Pro is the target:

In file included from BlinkMTester.ino:22:0:
BlinkM_funcs.h: In function 'void BlinkM_startPower()':
BlinkM_funcs.h:112:30: error: 'A3' was not declared in this scope
   BlinkM_startPowerWithPins( A3, A2 );

I was going to include some or all of the BlinkM_funcs.h code, but I can't find the file on my system!

Any helpful hints would be muchos apprevidados ;^) .

cheers,

Dave B.
                              ^

MichaelMeissner

  • Full Member
  • ***
  • Posts: 166
Re: problems trying to drive an I2C-controlled "BlinkM" LED module
« Reply #1 on: December 08, 2014, 07:53:53 am »
According to the pinout diagram on the kickstarter site (https://www.kickstarter.com/projects/digistump/digispark-pro-tiny-arduino-ready-mobile-and-usb-de), the Digispark Pro does not have analog pins designated A0 .. A4.  The first analog pin starts at A5.  So, in theory you would use one of those pins.  However, given BlinkM is an i2c device, I'm not sure what it needs two analog pins for.  On the ATtiny167, the i2c pins are 0 and 2.
« Last Edit: December 08, 2014, 12:51:52 pm by MichaelMeissner »

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: problems trying to drive an I2C-controlled "BlinkM" LED module
« Reply #2 on: December 19, 2014, 12:33:07 am »
Check this drawing for SDA and SCL for I2C lines.  They are listed as 0-A and 2-A

http://digispark.s3.amazonaws.com/DigisparkProDiagram2.png

defragster

  • Sr. Member
  • ****
  • Posts: 467
Re: problems trying to drive an I2C-controlled "BlinkM" LED module
« Reply #3 on: December 19, 2014, 12:23:00 pm »
I found and setup the I2C OLED library using my Beta Pro and the code works the same on UNO as the PRO with the 'default' <Wire.h> software setting for the SDA/SCL pins - it was just up to me to connect correctly on the breadboard.

The new Full 1.5.8 IDE release has a sample for i2cScanner and this app runs to find all reporting device addresses.  The Sketch does not define the SDA/SCL pins - that must be built into <Wire.h>.  This sketch should find and ID the BlinkM if wired and working.

If the i2cScanner app works - then maybe the wrong wire library is in use in your sketch.  Looking at USI_TWI_Master.h in the wire library I find these items that match the 'ATTiny' drawing are "#if defined" specific:
    #define PIN_USI_SDA         PINB0
    #define PIN_USI_SCL         PINB2