Blinky Leds with mbed-src lpc1768

Dependencies:   mbed-src

Files at this revision

API Documentation at this revision

Comitter:
RCMISbed
Date:
Fri Oct 12 15:44:32 2018 +0000
Commit message:
mbed-src blinky lpc1768

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed-src.lib Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 9a9808721f4b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri Oct 12 15:44:32 2018 +0000
@@ -0,0 +1,35 @@
+#include "mbed.h"
+
+#define TSample        0.001
+#define Periode        900
+#define onTime          10
+
+DigitalOut led(LED1);
+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;
+}
+
diff -r 000000000000 -r 9a9808721f4b mbed-src.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed-src.lib	Fri Oct 12 15:44:32 2018 +0000
@@ -0,0 +1,1 @@
+http://os.mbed.com/users/mbed_official/code/mbed-src/#a11c0372f0ba