Lichtklingel: Unterschied zwischen den Versionen
Eest9 (Diskussion | Beiträge) K wikifoo |
Keine Bearbeitungszusammenfassung |
||
Zeile 33: | Zeile 33: | ||
const char* ssid = "Metalab Secure"; | const char* ssid = "Metalab Secure"; | ||
const char* password = " | const char* password = "metaf00lab"; | ||
int alarmo = 0; | int alarmo = 0; | ||
Zeile 42: | Zeile 42: | ||
WiFi.begin(ssid, password); | WiFi.begin(ssid, password); | ||
while(WiFi.status() != WL_CONNECTED) { | while(WiFi.status() != WL_CONNECTED) { | ||
delay(500); | |||
Serial.print("."); | |||
} | |||
Serial.println("Verbindung, YEAH!"); | |||
} | } | ||
Zeile 62: | Zeile 64: | ||
Serial.print("."); | Serial.print("."); | ||
} | } | ||
Serial.println(""); | Serial.println("Verbindung, YEAH!"); | ||
Serial.print("Connected to WiFi network with IP Address: "); | Serial.print("Connected to WiFi network with IP Address: "); | ||
Serial.println(WiFi.localIP()); | Serial.println(WiFi.localIP()); | ||
} | } | ||
HTTPClient http; | HTTPClient http; | ||
Serial.println("Start Alarm"); | |||
//TURN ON Hauptraum-Alarm | //TURN ON Hauptraum-Alarm | ||
String serverPath = "http://hauptraumalarm/cm?cmnd=Power%20ON"; | String serverPath = "http://hauptraumalarm/cm?cmnd=Power%20ON"; | ||
Zeile 102: | Zeile 104: | ||
httpResponseCode = http.GET(); | httpResponseCode = http.GET(); | ||
http.end(); | http.end(); | ||
Serial.println("End alarm"); | |||
WiFi.disconnect(); | WiFi.disconnect(); |
Version vom 5. März 2022, 15:53 Uhr
Sprache: | Deutsch |
---|
Subpages:
Lichtklingel hat keine Unterseiten.
Lichtklingel
Türklingel ist auditiv nicht barrierefrei für gehörlose und hörbehinderte Menschen.
Ebenso können Kopfhörernutzer*innen die Türklingel oftmals verpassen. Daher wurde die Glocke an das Cleanup-Lichtsignal angehängt. Jetzt leuchtet die Leuchtbirne im Hauptraum, Whateverlab und in der Bibliothek und schaltet sich nach 10 Sekunden ab.
Lichtklingel | |
![]() | |
Gestartet: | 2022-03-02 |
Involvierte: | fussel |
Status: | active |
Beschreibung: | Signalleuchte leuchtet, wenn wer an der Türe läutet. |
Shutdownprozedur: | Kann laufen gelassen werden |
Zuletzt aktualisiert: | 2022-03-05 |
-
Löten am Lochrasterplatine
-
MH-ET LIVE D1 Mini ESP32
-
Türklingel mit Baugehäuse drangehängt
Schaltung
-
Schaltplan der Platte
Code
#include <WiFi.h> #include <HTTPClient.h> const char* ssid = "Metalab Secure"; const char* password = "metaf00lab"; int alarmo = 0; void setup() { Serial.begin(115200); Serial.println("start"); pinMode(25,INPUT_PULLUP); WiFi.begin(ssid, password); while(WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("Verbindung, YEAH!"); } void loop() { if(digitalRead(25)==LOW){ alarmo++; Serial.println(alarmo); if(alarmo > 20){ if(WiFi.status() != WL_CONNECTED) { WiFi.disconnect(); WiFi.begin(ssid, password); Serial.println("Connecting"); while(WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } Serial.println("Verbindung, YEAH!"); Serial.print("Connected to WiFi network with IP Address: "); Serial.println(WiFi.localIP()); } HTTPClient http; Serial.println("Start Alarm"); //TURN ON Hauptraum-Alarm String serverPath = "http://hauptraumalarm/cm?cmnd=Power%20ON"; http.begin(serverPath.c_str()); int httpResponseCode = http.GET(); http.end(); //TURN ON WEL-Alarm serverPath = "http://welalarm/cm?cmnd=Power%20ON"; http.begin(serverPath.c_str()); httpResponseCode = http.GET(); http.end(); //TURN ON Bib-Alarm serverPath = "http://bibliothekalarm/cm?cmnd=Power%20ON"; http.begin(serverPath.c_str()); httpResponseCode = http.GET(); http.end(); //Wait 10 seconds delay(10000); //TURN OFF Hauptraum-Alarm serverPath = "http://hauptraumalarm/cm?cmnd=Power%20OFF"; http.begin(serverPath.c_str()); httpResponseCode = http.GET(); http.end(); //TURN OFF WEL-Alarm serverPath = "http://welalarm/cm?cmnd=Power%20OFF"; http.begin(serverPath.c_str()); httpResponseCode = http.GET(); http.end(); //TURN OFF Bib-Alarm serverPath = "http://bibliothekalarm/cm?cmnd=Power%20OFF"; http.begin(serverPath.c_str()); httpResponseCode = http.GET(); http.end(); Serial.println("End alarm"); WiFi.disconnect(); alarmo = 0; } } else { alarmo--; } if(alarmo < 0){ alarmo = 0; } }