Pages: [1]   Go Down
Author Topic: blinkm addressing problem.. (try it on your blink)  (Read 5463 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

hi everyone,

so i am having an issue trying to readdress a blinkM, i've also tried on a MaxM, but i would guess the firmware is the similar to a point.

so, i started with my own bit of code to sort out what i knew and didnt know about i2c, a fair bit - but i can write to the blink's with no problem. i have 3 pots hooked up and can control rgb directly. nothing new, i know, but it was an exercise.

so the next step is to control multiple blinks, independently. i can't get the addresses to stick though.  here is my edited version of the stock code that is in the examples. i could be doing something silly, like sending hex instead of int, or something very strange could be going on... any help would be appreciated.  

Code:
#include "Wire.h"
#include "BlinkM_funcs.h"

byte blinkm_addr = 0x08;
byte blinkm_globaladdr = 0x00;
int temp;

void setup()
{
    Serial.begin(19200);

    Serial.println("BlinkMFactoryReset");

    BlinkM_beginWithPower();
    
    delay(100);

    Serial.print("Setting I2C address...");
    BlinkM_setAddress( blinkm_addr );
    Serial.println(blinkm_addr, HEX);
    
    delay(500);
    
    Serial.print("Verifying I2C address, sent to 'correct' address...");

    temp = BlinkM_checkAddress( blinkm_addr ); //sent to what it should be

    Serial.println(temp,DEC);
    
    delay(500);

    Serial.print("Verifying I2C address, sent to global address...");
    temp = BlinkM_checkAddress( blinkm_globaladdr );

//sent to global, should return matching

    Serial.println(temp,DEC);
    
    Serial.println("Did it work?");

}

void loop()
{
    digitalWrite(13, HIGH); // flash Arduino LED for fun
    delay(300);
    digitalWrite(13, LOW);
    delay(300);
}


Thanks -- Jon   smiley
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

...as continuation, i looked inside the blinkM_funcs.h and uncommented some of the debug messages, no change, still having an address problem.

here is the response, sorry it a bit of a mess

Code:
BlinkMFactoryReset
Setting I2C address...8
Verifying I2C address, sent to 'correct' address...received addr: 0x80
VerifyiBlinkMFactoryReset
Setting I2C address...8
Verifying I2C address, sent to 'correct' address...received addr: 0x80
Verifying I2C address, sent to global address...No response, that's not good
-1
Did it work?


Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

and as a followup to my own post, hope this helps someone else...

haven't tried it yet, i'll give some feedback to see if it helps.

http://todbot.com/blog/2010/11/19/reflashblinkm-update-your-blinkms-firmware/

Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

fail... :-(  

i have 1.0c blinkm's   anyone?
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 16
Maker of BlinkM and blink(1), ScrewShield, Wiichuck adpater, and many other Arduino thingies
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Have you tried using the "BlinkMTester" Arduino sketch that comes as part of the BlinkM Examples bundle?  It has the ability to let you re-address BlinkMs and I use it all the time.

The home of the BlinkM Examples bundle lives here:
http://code.google.com/p/blinkm-projects/
You can download the examples as a zip file here:
http://code.google.com/p/blinkm-projects/downloads/list
Or you can examine the source code to BlinkMTester here:
http://code.google.com/p/blinkm-projects/source/browse/trunk/blinkm_examples/arduino/BlinkMTester/BlinkMTester.pde

Let me know if BlinkMTester works.  If it doesn't, but otherwise the BlinkM appears to function, then you may have a bad BlinkM.  We can arrange an exchange for you then.
Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

HI Todd, thanks for the reply. The example does work, but i am getting strange results when i request the address. here is the output below.

Code:
Looking for a BlinkM: Device found at addr 2
cmd>A
Resetting address to default 9:
cmd>A1
Setting address to: 1
cmd>a
Address: -1
cmd>


what do you think? is this normal, or something a bit strange?  i can complete my project, but i think it's odd that the firmware updater doesn't work, nor when requesting an address, to get something meaningful back.

thanks
jon

Logged

0
Offline Offline
Jr. Member
**
Karma: 1
Posts: 74
...blowing up boards one connection at a time
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

and... the last one...

it works, but i am really confused at "how" to send the addresses.

if the default address is 0x09, i would expect to change the address in a similar format - like 0x11, or 0x34. but if i write the destination address in that format - no luck, it doesn't work - if i write as plain 11 or 34, it works, so what is the  " "  or ' ' or 0x  for??  

byte blinkm1 = 11;  //default is 0x09, re-addressed
byte blinkm2 = 34;

thanks anyone for your help...
_J
Logged

Pages: [1]   Go Up
Jump to: