diff options
author | Mike Causer <mcauser@gmail.com> | 2016-07-28 14:24:21 +1000 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-08-01 14:39:57 +0300 |
commit | b4564841b687051425924228acedcd6377ad1acf (patch) | |
tree | 0cb33c2839eeeefeedb6267cea6840a25b1f0483 /docs/esp8266/quickref.rst | |
parent | 0e4cae521288208e637d609fc00503fc828217b6 (diff) | |
download | micropython-b4564841b687051425924228acedcd6377ad1acf.tar.gz micropython-b4564841b687051425924228acedcd6377ad1acf.zip |
docs: Add DHT to ESP8266 Quick Ref and Tutorial
Diffstat (limited to 'docs/esp8266/quickref.rst')
-rw-r--r-- | docs/esp8266/quickref.rst | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/docs/esp8266/quickref.rst b/docs/esp8266/quickref.rst index 779248369f..1a63516f85 100644 --- a/docs/esp8266/quickref.rst +++ b/docs/esp8266/quickref.rst @@ -291,6 +291,24 @@ For low-level driving of an APA102:: import esp esp.apa102_write(clock_pin, data_pin, rgbi_buf) +DHT driver +---------- + +The DHT driver is implemented in software and works on all pins:: + + import dht + import machine + + d = dht.DHT11(machine.Pin(4)) + d.measure() + d.temperature() # eg. 23 (°C) + d.humidity() # eg. 41 (% RH) + + d = dht.DHT22(machine.Pin(4)) + d.measure() + d.temperature() # eg. 23.6 (°C) + d.humidity() # eg. 41.3 (% RH) + WebREPL (web browser interactive prompt) ---------------------------------------- |