Demo code minor BioRobotics 2016 University of Twente, Enschede, NL Verify that MODSERIAL is working again.

Dependencies:   MODSERIAL mbed

Files at this revision

API Documentation at this revision

Comitter:
megrootens
Date:
Mon Sep 12 15:00:59 2016 +0000
Commit message:
Verify that MODSERIAL is working again.

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	Mon Sep 12 15:00:59 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	Mon Sep 12 15:00:59 2016 +0000
@@ -0,0 +1,38 @@
+/**
+ * Quick check to verify that indeed MODSERIAL is working again.
+ */
+
+#include "mbed.h"
+#include "MODSERIAL.h"
+
+#define SERIAL_BAUD 115200
+
+MODSERIAL pc(USBTX,USBRX);
+DigitalOut led(LED_RED);
+
+// period with which Foo() is to be called
+const float kPeriodFoo = 1.0f;
+
+/**
+ * Foo function.
+ * @ensure foobar.
+ */
+void Foo()
+{
+    led = !led;
+    pc.printf("led is %s\r\n",led?"OFF":"ON");
+}
+
+/**
+ * Main function.
+ */
+int main()
+{
+    pc.baud(SERIAL_BAUD);
+    pc.printf("\r\n**RESET**\r\n");
+    
+    Ticker tick_foo;
+    tick_foo.attach(&Foo,kPeriodFoo);
+    
+    while (true);
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Sep 12 15:00:59 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/2e9cc70d1897
\ No newline at end of file