Ticker

Dependencies:   MODSERIAL mbed

Files at this revision

API Documentation at this revision

Comitter:
luukblaauw
Date:
Thu Sep 15 14:59:45 2016 +0000
Commit message:
Ticker

Changed in this revision

MODSERIAL.lib Show annotated file Show diff for this revision Revisions of this file
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/MODSERIAL.lib	Thu Sep 15 14:59:45 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/Sissors/code/MODSERIAL/#4737f8a5b018
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 15 14:59:45 2016 +0000
@@ -0,0 +1,24 @@
+#include "mbed.h"
+#include "MODSERIAL.h"
+Ticker tiktak;
+DigitalOut led(LED_RED);
+MODSERIAL pc(USBTX, USBRX);
+
+volatile int n_5sec_passed = 0;
+
+void TrackTime()
+{
+    n_5sec_passed++;
+    }
+    
+
+int main()
+{
+    tiktak.attach(&TrackTime,5);
+    pc.baud(9600);
+    while (true) {
+        led = !led; // toggle led
+        wait(0.2f);
+        pc.printf("%i maal 5 seconde geweest.\r\n",n_5sec_passed);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Sep 15 14:59:45 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/2e9cc70d1897
\ No newline at end of file