This demo program output text to the serial link once a second. It was written as part of the Heriot Watt Robotics Society Hamilton Circle Electronics Workshop

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
coloursearch
Date:
Thu Nov 09 17:05:43 2017 +0000
Commit message:
This program output to terminal once a second

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Nov 09 17:05:43 2017 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"              
+ 
+Serial pc(USBTX, USBRX);
+
+int counter = 0;
+ 
+int main() {
+
+    while(1) {
+        counter++;
+        if(counter % 10 == 0){
+            pc.printf("%d\n\r", counter);
+        }
+        wait(0.1);
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Nov 09 17:05:43 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/e7ca05fa8600
\ No newline at end of file