Jack Hansdampf / Mbed OS ZustandGetreidetrocknungStufe1

Dependencies:   LCD_i2c_GSOE

Files at this revision

API Documentation at this revision

Comitter:
jack1930
Date:
Thu Jun 03 15:04:50 2021 +0000
Parent:
0:1f9f0461419d
Commit message:
Getreidetrocknung Zustand Geruest

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Wed Jun 02 10:57:16 2021 +0000
+++ b/main.cpp	Thu Jun 03 15:04:50 2021 +0000
@@ -7,7 +7,7 @@
 #include "LCD.h"
 
 lcd mylcd;
-int zeit= 20; //Zeit in ms
+int zeit= 100; //Zeit in ms
 
 PortOut zustand(PortC,0b1111);
 DigitalOut warnlampe(PC_7);
@@ -29,33 +29,18 @@
     mylcd.printf("%s",txt);
 }
 
-void trocknenEin()
-{
-    if (zustand==Aus)
-    {
-        zustand=Anlaufen;
-        melden("Anlauf");
-    }
+void trocknenEin(){
+}
+
+void trocknenAus(){
 }
 
-void trocknenAus()
-{
-    if (zustand==Betrieb)
-    {
-        zustand=Abschalten;
-        melden("Abschalten");
-    }
-}
-
-void init()
-{
+void init(){
     TrocknenEin.mode(PullDown);
     TrocknenAus.mode(PullDown);
-    Lichtschranke.mode(PullDown);
-    
+    Lichtschranke.mode(PullDown);    
     TrocknenEin.rise(&trocknenEin);
-    TrocknenAus.rise(&trocknenAus);
-    
+    TrocknenAus.rise(&trocknenAus);   
     zustand=Aus;
 }
 
@@ -65,23 +50,7 @@
     melden("bereit");
 
     while (true) {
-        switch(zustand)
-        {
-            case Anlaufen: 
-                if (Lichtschranke==1)
-                {
-                    zustand=Betrieb;
-                    melden("Betrieb");
-                }
-                break;
-            case Abschalten: 
-                if (Lichtschranke==0)
-                {
-                    zustand=Aus;
-                    melden("bereit");
-                }
-                break;
-        }
+
 
         HAL_Delay(zeit);
     }