Added BlinkM support over i2c

This commit is contained in:
Tim Koster
2013-09-10 12:18:29 +03:00
parent aa6c58ad37
commit 7016cc9511
4 changed files with 57 additions and 0 deletions

23
Marlin/BlinkM.cpp Normal file
View File

@ -0,0 +1,23 @@
/*
BlinkM.cpp - Library for controlling a BlinkM over i2c
Created by Tim Koster, August 21 2013.
*/
#if (ARDUINO >= 100)
# include "Arduino.h"
#else
# include "WProgram.h"
#endif
#include "BlinkM.h"
void SendColors(byte red, byte grn, byte blu)
{
Wire.begin();
Wire.beginTransmission(0x09);
Wire.write('o'); //to disable ongoing script, only needs to be used once
Wire.write('n');
Wire.write(red);
Wire.write(grn);
Wire.write(blu);
Wire.endTransmission();
}