mbed blinky lpc1768

Dependencies:   mbed

Revision:
0:473841607aa9
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 12 16:06:44 2018 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+#define TSample        0.001
+#define Periode        300
+#define onTime          10
+
+DigitalOut led(LED4);
+DigitalOut son(p8);
+//DigitalOut son(PA_1);
+
+int wdt = 0;
+char msg[] = "Salut artiste";
+Ticker TMainProcess;
+
+void MainProcess_Isr(void){
+    --wdt; 
+    if((wdt< onTime)& (wdt> 0)){led= 1;};
+    if(wdt<= 0){led= 0; wdt= Periode;};   
+    }
+
+void init(void){
+ //   son= 1;
+    TMainProcess.attach(&MainProcess_Isr, TSample); 
+    son= 0;
+    }
+
+
+// main() runs in its own thread in the OS
+int main(void) {
+    led= 0;
+    TMainProcess.attach(&MainProcess_Isr, TSample); 
+    while (true) {};
+    return 3;
+}
+