Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 3:138c53fedf4e
- Parent:
- 2:f7beca47603f
- Child:
- 4:5d2c270135ef
--- a/main.cpp Thu Jun 03 16:26:49 2021 +0000
+++ b/main.cpp Thu Jun 03 16:58:45 2021 +0000
@@ -16,6 +16,7 @@
InterruptIn TrocknenAus(PA_6);
DigitalIn Lichtschranke(PB_0);
+
//Zustandsdefinitionen
#define Aus 0b0000
#define Anlaufen 0b1110
@@ -27,6 +28,7 @@
+
void melden(const char* txt)
{
mylcd.clear();
@@ -47,6 +49,7 @@
{
if (zustand==Betrieb)
{
+ warnlampe=0;
zustand=Abschalten;
melden("Abschalten");
}
@@ -63,8 +66,21 @@
}
+int z=0;
+void ueberwachen()
+{
+ if (z>5) warnlampe=0;
+ else warnlampe=1;
+ z=0;
+}
+void luefter()
+{
+ z++;
+}
+InterruptIn Luefter(PA_1);
void init()
{
+ Luefter.rise(&luefter);
HALT.mode(PullDown);
HALT.rise(&halt);
TrocknenEin.mode(PullDown);
@@ -77,6 +93,8 @@
zustand=Aus;
}
+
+
int main()
{
init();
@@ -117,6 +135,8 @@
melden("Abschalten");
}
break;
+ case Betrieb: ueberwachen();
+ break;
}
HAL_Delay(zeit);