Multiple BlinkMs Sketch "freezes" - help

Hello all!

Im the newest member here! :slight_smile:

I am a total beginner but have been making a lot of progress on my own, until now. I recently have been playing with some BlinkMs (wow these are really cool)

I have 3 BlinkMs on a breadboard all hook to my Arduino Duemilanove. They each have a different address (0x01, 0x02, 0x03)

I wrote a little sketch (poorly im sure) and it runs the loop 3 times and then stops. The led continues to go on blinking at 3 sec intervals but the BlinkMs stop changing color. They stay one a random hue.

Any help would be great. Please bear with me; while im not looking for someone to hold my hand I am still learning.

Here is my sketch:

/*
 * My MultiControl ~ping
 */

#include "Wire.h"
#include "BlinkM_funcs.h"

byte addr1 = 0x01;
byte addr2 = 0x02;
byte addr3 = 0x03;
byte all = 0x00;
int ledPin = 13;


void setup() 
{
pinMode (ledPin, OUTPUT);
Serial.begin(19200);
Serial.println("Whateverzzzz");

delay (1000);
BlinkM_beginWithPower();
delay(100);
}






void loop() 
{
BlinkM_begin () ;
BlinkM_stopScript (all);
BlinkM_fadeToRGB (addr1,0xff,0x00,0x00);
BlinkM_fadeToRGB (addr2,0x00,0xff,0x00);
BlinkM_fadeToRGB (addr3,0x00,0x00,0xff);
digitalWrite (ledPin, HIGH);
delay (3000);
BlinkM_fadeToRGB (all,0xff,0xff,0xff);
digitalWrite (ledPin, LOW);
delay (3000);
BlinkM_fadeToRGB (all,0xff,0xcc,0xee);
digitalWrite (ledPin, HIGH);
delay (3000);
BlinkM_fadeToRGB (all,0x88,0x88,0x88);
digitalWrite (ledPin, LOW);
delay (3000);
BlinkM_fadeToHSB (addr1,150,150,50);
BlinkM_fadeToHSB (addr2,150,150,155);
BlinkM_fadeToHSB (addr3,150,150,255);
digitalWrite (ledPin, HIGH);
delay (3000);
BlinkM_fadeToHSB (all,100,255,255);
digitalWrite (ledPin, LOW);
delay (3000);
BlinkM_fadeToRandomRGB (all,0xff,0xff,0xff);
digitalWrite (ledPin, HIGH);
delay (3000);

}

I'm not familiar with BlinkMs, but this does not look right.

void loop()
{
[glow]BlinkM_begin () ;[/glow]
BlinkM_stopScript (all);
BlinkM_fadeToRGB (addr1,0xff,0x00,0x00);
BlinkM_fadeToRGB (addr2,0x00,0xff,0x00);
BlinkM_fadeToRGB (addr3,0x00,0x00,0xff);

Typically, begin methods are not called in loop, because loop is called in an endless loop.

ok P aul I think you might be on to something. That should probbly all be in the setup then you think? I'll give it a go.

Thank you for the suggestion. I have implemented it and it works great! :slight_smile: