projectwerk

Dependencies:   NeoPixelString SimplyLog

Fork of NeoPixelI2cSlave by Nico De Witte

Revision:
2:e0269262d1f2
Parent:
0:3a31c84ed525
Child:
3:02931c2b1e82
diff -r a93d16b04770 -r e0269262d1f2 neopixel_i2c_daemon.cpp
--- a/neopixel_i2c_daemon.cpp	Sun Oct 25 11:27:26 2015 +0000
+++ b/neopixel_i2c_daemon.cpp	Sun Oct 25 11:36:21 2015 +0000
@@ -3,8 +3,9 @@
 #define DEBUG_MODE 1
 #include "log.h"
 
-NeoPixelI2cDaemon::NeoPixelI2cDaemon(I2cDevice * i2c){
+NeoPixelI2cDaemon::NeoPixelI2cDaemon(I2cDevice * i2c, PinName alive_pin) : alive(alive_pin) {
     this->i2c = i2c;
+    cAlive = 0;
 }
 
 void NeoPixelI2cDaemon::attachPixelString(NeoPixelString * pixelstring) {
@@ -101,5 +102,11 @@
         for(int i = 0; i < 10; i++) {
             buffer[i] = 0;    // Clear buffer
         }
+        
+        // Alive LED
+        cAlive = (cAlive + 1) % 100000;
+        if (!cAlive) {
+            alive = !alive;
+        }
     }
 }
\ No newline at end of file