Sille Van Landschoot / Mbed 2 deprecated mbed_slave_full

Dependencies:   mbed

Revision:
1:e8ff4ff5a726
Parent:
0:e24b497adfce
Child:
2:49bb6ee1191c
--- a/main.cpp	Mon Oct 13 13:27:05 2014 +0000
+++ b/main.cpp	Mon Oct 13 13:31:30 2014 +0000
@@ -1,10 +1,10 @@
 #include "mbed.h"
 
-DigitalOut myled(LED1);
+DigitalOut aLED(LED1);
 Serial pc(USBTX, USBRX); // tx, rx
 I2CSlave slave(p28, p27);
 
-const int SLAVE_ADDRESS = 0x85;
+const int SLAVE_ADDRESS = 0x84;
 const int MEMORY_SIZE = 16;
 
 int memory[MEMORY_SIZE];
@@ -24,6 +24,9 @@
 
     // Make sure memory buffer is zeroed
     initializeMemory();
+    
+    // Alive LED
+    int cAlive = 0;
 
 
     char buffer[10];
@@ -52,9 +55,10 @@
         }
         for (int i = 0; i < 10; i++) buffer[i] = 0;   // Clear buffer
         
-        /*myled = 1;
-        wait(1);
-        myled = 0;
-        wait(1);*/
+        // Alive LED
+        cAlive = (cAlive + 1) % 100000;
+        if (!cAlive) {
+            aLED = !aLED;
+        }
     }
 }