BlinkM.cpp 557 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. BlinkM.cpp - Library for controlling a BlinkM over i2c
  3. Created by Tim Koster, August 21 2013.
  4. */
  5. #include "Marlin.h"
  6. #ifdef BLINKM
  7. #if (ARDUINO >= 100)
  8. # include "Arduino.h"
  9. #else
  10. # include "WProgram.h"
  11. #endif
  12. #include "BlinkM.h"
  13. void SendColors(byte red, byte grn, byte blu)
  14. {
  15. Wire.begin();
  16. Wire.beginTransmission(0x09);
  17. Wire.write('o'); //to disable ongoing script, only needs to be used once
  18. Wire.write('n');
  19. Wire.write(red);
  20. Wire.write(grn);
  21. Wire.write(blu);
  22. Wire.endTransmission();
  23. }
  24. #endif //BLINKM