homayoun mh / Mbed 2 deprecated Arduino_BlinkWithoutDelay_Timer

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
homayoun
Date:
Wed Sep 03 10:59:19 2014 +0000
Commit message:
Arduino_BlinkWithoutDelay_Timer sample code ported.

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 9dccd331cbdc main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Sep 03 10:59:19 2014 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+Timer t;
+int interval = 1000;
+
+void setup()
+{
+    t.start();
+}
+
+void loop()
+{
+    if(t.read_ms() > interval) {
+        t.reset();
+        myled = !myled;
+    }
+}
+
+int main()
+{
+    setup();
+    while(1) loop();
+}
diff -r 000000000000 -r 9dccd331cbdc mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Sep 03 10:59:19 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/9327015d4013
\ No newline at end of file