M0_Übung_3b

Dependencies:   mbed

Fork of M0_Lektion03b by Gottfried Enenkel

Revision:
1:4ffe29914292
Parent:
0:9fc800807876
--- a/main.cpp	Mon Mar 09 12:11:36 2015 +0000
+++ b/main.cpp	Thu Apr 21 07:54:33 2016 +0000
@@ -1,16 +1,66 @@
-//  HIMBED Lektion03b   "VERKEHRSAMPEL"      
-//  BULME GRAZ      by Enenkel     26.2.2015
-// Aufgabe:   Programmieren eine Verkehrsmpael
-//  while(1)
-//    rot  5 sec
-//    gelb 2 sec  (gelb = rot +grün)
-//    grün 4 sec   
-//    grün blinken 3x a 1 sec hell 1 sec dunkel
-//    gelb 2 sec 
-//     
 #include "mbed.h"
 
-// den Rest scheibst selber !
+// **** DEFINITIONEN ****
+
+DigitalOut ledGR(p5);   
+DigitalOut ledBL(p34);  
+DigitalOut ledRT(p36);  
+
+// **** HAUPTPROGRAMM ****
 
-
-// **************   END ***************
+int main()
+{
+    while(1) {
+        ledGR = 1;   
+        ledBL = 1;
+        ledRT = 0;
+        wait(5); 
+        
+        ledGR = 0;   
+        ledBL = 1;
+        ledRT = 0;
+        wait(2); 
+        
+        ledGR = 0;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(4); 
+        
+        ledGR = 0;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(1);
+        
+        ledGR = 1;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(1);
+        
+        ledGR = 0;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(1);
+        
+        ledGR = 1;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(1);
+        
+        ledGR = 0;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(1);
+        
+        ledGR = 1;   
+        ledBL = 1;
+        ledRT = 1;
+        wait(1);
+        
+        ledGR = 0;   
+        ledBL = 1;
+        ledRT = 0;
+        wait(2); 
+         
+             }
+}
+// **** ENDE ****
\ No newline at end of file