Basic serial output program

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ethanharstad
Date:
Fri Jun 06 19:16:10 2014 +0000
Parent:
0:3619ce83ea6c
Commit message:
Rename file

Changed in this revision

HelloWorld.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/HelloWorld.cpp	Fri Jun 06 19:16:10 2014 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+unsigned int counter = 0;   // Keep count of lifetime
+Serial pc(USBTX, USBRX);    // Talk to the computer
+
+void count() {
+    // Announce lifetime
+    pc.printf("I have been alive for %i seconds.\n", counter);
+    counter++;  // Count up by 1
+}
+
+int main() {
+    pc.printf("Hello world!\n");    // Say hello
+    while(true) {   // Main loop
+        count();    // Call our function
+        wait(1);    // Wait for 1 second
+    }               // Repeat
+}
\ No newline at end of file
--- a/main.cpp	Sun Jun 01 03:20:13 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,18 +0,0 @@
-#include "mbed.h"
-
-unsigned int counter = 0;   // Keep count of lifetime
-Serial pc(USBTX, USBRX);    // Talk to the computer
-
-void count() {
-    // Announce lifetime
-    pc.printf("I have been alive for %i seconds.\n", counter);
-    counter++;  // Count up by 1
-}
-
-int main() {
-    pc.printf("Hello world!\n");    // Say hello
-    while(true) {   // Main loop
-        count();    // Call our function
-        wait(1);    // Wait for 1 second
-    }               // Repeat
-}
\ No newline at end of file