ESP8266/Uebertrafficlight

Aus C3MAWiki
Version vom 9. Januar 2016, 01:15 Uhr von Ollo (Diskussion | Beiträge) (Ueber Traffic Light)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Zur Navigation springenZur Suche springen

Uber Traffic Light

Die Ampel hat drei Fraben, welche alle einzeln wie folgt geschaltet werden können:

mosquitto_pub -h bigbrother -t "/room/trafficlight/red/command" -m "on"
mosquitto_pub -h bigbrother -t "/room/trafficlight/yellow/command" -m "on"
mosquitto_pub -h bigbrother -t "/room/trafficlight/green/command" -m "on"

Neben den Befehlen on und off kann auch eine Blinkfrequenz wie folgt festgelegt werden:

mosquitto_pub -h bigbrother -t "/room/trafficlight/yellow/command" -m "blink 200"

Bei den statischen Befehlen on und off wird der aktuelle Zustand auch ausgegben:

mosquitto_sub -h bigbrother -v -t "/room/trafficlight/#"
/room/trafficlight/yellow/state off
/room/trafficlight/red/state on
/room/trafficlight/green/state on