weitere Befehle int; double; while; ...

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
Enenkel
Date:
Mon Mar 09 12:13:38 2015 +0000
Commit message:
Weitere Befehle int, double, while .....

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 56dbb8ec442b main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Mar 09 12:13:38 2015 +0000
@@ -0,0 +1,29 @@
+//  HIMBED _lektion05   int   double 
+//  HTL BULME Graz       by Enenkel      26.2.2014
+//  Da findet ihr mehr Info über C++    http://www.cplusplus.com/doc/tutorial/program_structure/
+//  Aufgabe:
+//  Erstelle ev. mit Hilfe von Bitschieben (Lektion 2) einen Punkt,
+//  der über die 12 LED huscht, und dabei immer schneller wird.
+//  Der Punkt soll 5 x über die LED huschen.
+//  Erst nach drücken der Reset Taste soll das Programm erneut starten.
+#include "mbed.h"
+
+DigitalOut led(LED1);
+int i;     
+double x;  
+
+int main() {
+i=1;
+x=0.1;
+    while(i<=25) {
+        led = 1;
+        wait(x);
+        led = 0;
+        wait(x);
+        i++;       // i=i+1
+        x=x*1.1;   // Zeit x verlängern
+    }
+}
+// ACHTUNG der M0 führt die Software 2x aus,
+// dies obwohl er sie nur einmal ausführen sollte!
+// liegt vermutlich am Compiler..... 
diff -r 000000000000 -r 56dbb8ec442b mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Mar 09 12:13:38 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4fc01daae5a5
\ No newline at end of file