Skip to content

Instantly share code, notes, and snippets.

@dave5623
Last active August 29, 2015 14:06
Show Gist options
  • Save dave5623/fcf0793ad5a850799371 to your computer and use it in GitHub Desktop.
Save dave5623/fcf0793ad5a850799371 to your computer and use it in GitHub Desktop.
#include <Wire.h>
int toggle = 0;
void setup()
{
Wire.begin();
}
void loop()
{
Wire.beginTransmission(0x09); // I2C address of the BlinkM
Wire.write('h'); // fade to HSB color
if (toggle % 2 == 0) {
Wire.write(0x00); // hue value for red
Wire.write(0x10); // saturation value
Wire.write(0x01); // brightness value
}
else{
Wire.write(0x55); // hue value for green
Wire.write(0x10); // saturation value
Wire.write(0x01); // brightness value
}
Wire.endTransmission();
toggle++;
delay(3000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment