Hi,
I have the octopus temperature and humidity sensor for the micro:bit. I'm trying to program it with the MicroPython Mu editor, but when I flash the program into the micro:bit, the LED matrix shows: "line x import error no module named 'dht'".
How do modules work for micro:bit MicroPython? I thought that if I called it at the begginning of the program it would work...
The code:
from microbit import *
import dht
import machine
import time
sensor = dht.DHT11(machine.Pin(0))
while True:
sensor.measure()
print('Temperature = %.2f' % sensor.temperature())
print('Humidity = %.2f' % sensor.humidity())
time.sleep(3)
What can I do to make it work?
Thanks
octopus temperature and humidity sensor DHT
-
- Posts: 363
- Joined: Sun Apr 17, 2016 1:55 pm
Re: octopus temperature and humidity sensor DHT
dht is not build-in module in microbit. You may try BME280 or other I2C sensor.