Got the RGB LED working

Met Tom in my lab to make more progress on the ArduIMU gloves. While testing the ArduIMU gloves with the Bluetooth module, I found that the ArduIMU could sometimes continuously reset.  The ArduIMU uses the DTR line to reset prior to bootloading, so I cut this connection on the Bluetooth module and it the problem was solved.

Cut Bluetooth DTR Linehttp://dev-blog.mimugloves.com/wp-content/uploads/2013/01/Cut-Bluetooth-DTR-Line-300x270.png 300w" sizes="(max-width: 305px) 100vw, 305px" />

The ArduIMU only had two hardware PWM pins aviable, not enough for the three channels of an RGB LED so we decided to use the MinM I2C RGB LED.  I was really impressed with this device.  It took just a few minutes to get working and barely any code.


void I2CBus::init() {

// Init I2C
Wire.begin();
delay(10);

// Setup up MinM
Wire.beginTransmission(MINM_ADDR);
Wire.write('o');    // stop script
Wire.endTransmission();
Wire.beginTransmission(MINM_ADDR);
Wire.write('n');    // set RGB
Wire.write(0);
Wire.write(0);
Wire.write(0);
Wire.endTransmission();
}

void I2CBus::setRGB(const unsigned char red, const unsigned char green, const unsigned char blue) {
Wire.beginTransmission(MINM_ADDR);
Wire.write('n');    // use 'c' to fade transitions
Wire.write(red);
Wire.write(green);
Wire.write(blue);
Wire.endTransmission();
}

Tom and I worked together to get LED control packets sending from Glover and we were able to set the LED colour wirelessly from Tom’s laptop. I’d like to spend some time creating more complex LED commands and take advantage of the MinM’s script functionality.

The MinM pinout is design to match that of the Arduino/ArduIMU so we can simplify Hannah’s wiring design.

Leave a Reply