Ausgabe auf Serieller Schnttstelle

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
stefan1691
Date:
Thu Apr 16 07:27:10 2015 +0000
Commit message:
Ausgabe auf Serieller Schnttstelle

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 f029f923a83a main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Apr 16 07:27:10 2015 +0000
@@ -0,0 +1,24 @@
+/** Ausgabe auf Serieller Schnttstelle
+*/
+#include "mbed.h"
+
+DigitalOut myled(LED_GREEN);
+Serial pc(USBTX, USBRX);
+
+int main()
+{
+    int i = 0;
+    int u;
+    pc.printf("Hello World!\n");
+
+    while (true) 
+    {
+        wait(0.5f); // wait a small period of time
+        pc.printf("%d \n", i); // print the value of variable i
+        i++; // increment the variable
+        myled = !myled; // toggle a led
+        
+        pc.scanf( "%d", &u );
+        pc.printf("Eingabe war %d\n", u );
+    }
+}                   
diff -r 000000000000 -r f029f923a83a mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Apr 16 07:27:10 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/433970e64889
\ No newline at end of file