Skip to content

Instantly share code, notes, and snippets.

@yoshimax
Created May 4, 2013 22:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yoshimax/5519028 to your computer and use it in GitHub Desktop.
Save yoshimax/5519028 to your computer and use it in GitHub Desktop.
#include <Wire.h>
#include "BlinkM_funcs.h"
#define blinkm_addr 0x00
int val;
void setup(){
Serial.begin(9600);
pinMode(13,OUTPUT);
BlinkM_beginWithPower();
BlinkM_stopScript( blinkm_addr ); // turn off startup script
}
void loop(){
if(Serial.available()>0){
val=Serial.read();
}
if(val=='H'){
BlinkM_fadeToRGB(blinkm_addr,0xff,0xff,0xff);
digitalWrite(13,HIGH);
}else{
BlinkM_fadeToRGB(blinkm_addr,0x00,0x00,0x00);
digitalWrite(13,LOW);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment