Hauptprogramm

Dependencies:   ILI9340_Driver_Lib PM2_Libary Lib_DFPlayerMini

Revision:
17:621c4212fd4e
Parent:
16:f0480e9c5039
Child:
18:39be9e19768f
--- a/main.cpp	Wed Apr 21 13:48:47 2021 +0000
+++ b/main.cpp	Wed Apr 21 14:09:31 2021 +0000
@@ -94,6 +94,34 @@
 
         if (executeMainTask) {
             
+            //Zeitfunktion
+            uhrzeit(time(NULL));
+            
+            switch(i){
+                //2 Minuten
+                case 24:    i += 5;
+                            //Seesaw Programm
+                            ThisThread::sleep_for(5s); //Wartet 5s..
+                            break;
+                //5 Minuten
+                case 60:    i += 5;
+                            //Servo Bewegung
+                            ThisThread::sleep_for(5s); //Wartet 5s..
+                            break;
+                //7 Minuten
+                case 84:    i += 5;
+                            //Audio Signal
+                            ThisThread::sleep_for(5s); //Wartet 5s..
+                            break;
+                //10 Minuten
+                case 120:   i = 0;
+                            break;
+                            ThisThread::sleep_for(5s); //Wartet 5s..
+                default :   i += 5;
+                            ThisThread::sleep_for(5s); //Wartet 5s..
+                            break;
+            
+            
         for (int pos = 1000; pos < 2000; pos += 25) {
           Servo1.SetPosition(pos);
           wait_ns(50);
@@ -104,30 +132,9 @@
       }
         bewegung(zeit);
         
-        
-        //Zeitfunktion
-        uhrzeit(time(NULL));
-        
-        
-        //Zeitfunktionen
-        if (i != 360){
-        ThisThread::sleep_for(5s); //Wartet 5s..
-        printf("%d\n", i);
-        }
-        else{
-        i=0;
-        }
-        i += 5; 
-
         led = !led;
-
         } else {
-
-            
-            led = 0;
-        }
-
-    
+            led = 0;        } 
     }
 }