From 1539d9c452fdf56588d3cb1f015592097fe0b4d0 Mon Sep 17 00:00:00 2001 From: danielvici123 <94993276+danielvici@users.noreply.github.com> Date: Wed, 18 Dec 2024 11:42:05 +0100 Subject: [PATCH] infp, progp progp nicht fertig --- INF/sketch_dec13a/sketch_dec13a.ino | 66 ++++++ .../edicer-functions.php | 204 ++++++++++++++++++ 2 files changed, 270 insertions(+) create mode 100644 INF/sketch_dec13a/sketch_dec13a.ino create mode 100644 progp/24-12-18 -- edicer3 functions/edicer-functions.php diff --git a/INF/sketch_dec13a/sketch_dec13a.ino b/INF/sketch_dec13a/sketch_dec13a.ino new file mode 100644 index 0000000..ff55538 --- /dev/null +++ b/INF/sketch_dec13a/sketch_dec13a.ino @@ -0,0 +1,66 @@ +const int Taster2 = 2; +const int LED_rot = 32; +enum Zustaende_t { zoff, zlow, znorm, zhigh } Zustand; +bool T_druck; +uint32_t zeit = 0; + +void setup() { + pinMode(Taster2, INPUT_PULLUP); + pinMode(LED_rot, OUTPUT); + Serial.begin(115200); + Serial.println("TEST - DANIEL"); + ledcAttachChannel(LED_rot, 100, 12,0); + Zustand = zoff; +} + +void loop (){ + einlesen(); + verarbeiten(); + delay(10); +} + +void einlesen () { + static bool Neu, Alt; + Neu = digitalRead(Taster2); + if (Neu == 0 && Alt == 1) { + T_druck = true; + } else { + T_druck = false; + } + Alt = Neu; +} +void verarbeiten () { + switch (Zustand) { + case zoff: ledcWrite(LED_rot, 4095); + Serial.println("zoff "); + if (T_druck == true) { + Zustand = zlow; + } + break; + case zlow: ledcWrite(LED_rot, 3071); + Serial.println("zlow"); + if (T_druck == true){ + Zustand = znorm; + } + break; + case znorm: ledcWrite(LED_rot, 2047); + Serial.println("znorm"); + if (T_druck == true){ + Zustand = zhigh; + zeit = millis(); + } + break; + case zhigh: ledcWrite(LED_rot, 0); + Serial.println("zhigh"); + if (T_druck == true){ + Zustand = zoff; + } + if (millis() - zeit >= 5000){ + Zustand = znorm; + } + break; + default: + Serial.println("default"); + break; + } +} \ No newline at end of file diff --git a/progp/24-12-18 -- edicer3 functions/edicer-functions.php b/progp/24-12-18 -- edicer3 functions/edicer-functions.php new file mode 100644 index 0000000..61798d8 --- /dev/null +++ b/progp/24-12-18 -- edicer3 functions/edicer-functions.php @@ -0,0 +1,204 @@ + + +
+ + +Die Ergebnisse werden sortiert wie folgt sortiert: Klein >> Groß
+powered by Daniel
+"; + print_r($augen_array); + echo""; + */ + sort($augen_array); + + // Die Würfel zeigen + for ($i=0; $i<$anzahl; $i++){ + echo "
\n";
+ }
+
+ // Ausgabe der Augenzahlen
+ $summe = array_sum($augen_array);
+ echo "