Closed DAnGioi closed 4 years ago
My own program gets stuck after a amount of time getting the DHT sensor data. My Code:
import grovepi import time import math
blue = 0
dht_sensor = 4 grovepi.pinMode(dht_sensor, “INPUT”)
def dht_data(): [temp,humidity] = grovepi.dht(dht_sensor, blue) if not temp is None: string = “[temperature = {:.01f}][humidity = {:.01f}]”.format(temp,humidity) else: string = “waiting for buffer to fill” print(string)
while True: dht_data() time.sleep(15)
All the sensors I used had this problem. Is grove PI flawed?
My own program gets stuck after a amount of time getting the DHT sensor data. My Code:
import grovepi import time import math
blue = 0
dht_sensor = 4 grovepi.pinMode(dht_sensor, “INPUT”)
def dht_data(): [temp,humidity] = grovepi.dht(dht_sensor, blue) if not temp is None: string = “[temperature = {:.01f}][humidity = {:.01f}]”.format(temp,humidity) else: string = “waiting for buffer to fill” print(string)
while True: dht_data() time.sleep(15)
All the sensors I used had this problem. Is grove PI flawed?