MCPcopy Create free account
hub / github.com/DexterInd/GoPiGo3 / handle_dht

Function handle_dht

Software/Scratch/GoPiGo3Scratch.py:518–527  ·  view source on GitHub ↗
(regObj)

Source from the content-addressed store, hash-verified

516
517
518def handle_dht(regObj):
519 port = "SERIAL"
520 dht_sensor = get_sensor_instance(port, easysensors.DHTSensor)
521 if dht_sensor:
522 sensors = {"Temperature": dht_sensor.read_temperature(),
523 "Humidity": dht_sensor.read_humidity()}
524 else:
525 sensors = {"Temperature": "no readings",
526 "Humidity": "no readings" }
527 return sensors
528
529
530def handle_button(regObj):

Callers 1

Calls 3

get_sensor_instanceFunction · 0.85
read_temperatureMethod · 0.80
read_humidityMethod · 0.80

Tested by

no test coverage detected