Skip to content
Snippets Groups Projects
Commit 9cebf92a authored by Martin Winter's avatar Martin Winter
Browse files

added example weatherstation

parent 0b9d4b5d
No related branches found
No related tags found
No related merge requests found
import time
from machine import Pin
import dht
from mytrix import Matrix
greenled = Pin(25, Pin.OUT)
blueled = Pin(26, Pin.OUT)
yellowled = Pin(27, Pin.OUT)
d = dht.DHT11(Pin(14, Pin.IN))
room_id = ""
matrix = Matrix()
def send_values():
# Temperatur und Luftfeuchtigkeit messen
d.measure()
temp = d.temperature()
hum = d.humidity()
text="""Das aktuelle Wetter:
Temperature: %s
Humidity: %s%%"""% (temp,hum)
print(text)
matrix.send_room_message(room_id, text)
while True:
send_values()
time.sleep(30)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment