summaryrefslogtreecommitdiffstatshomepage
path: root/docs/esp8266/tutorial
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-08-29 12:52:50 +1000
committerDamien George <damien.p.george@gmail.com>2016-08-29 12:52:50 +1000
commit13c5a228c9ec9881087bdddd162f3b633edc3aa5 (patch)
tree40f2896f90b8fac8ce6d7592d2288c76a27fb5c2 /docs/esp8266/tutorial
parent59a9509703c6e525b3419ffea1b69f3b6992e006 (diff)
downloadmicropython-13c5a228c9ec9881087bdddd162f3b633edc3aa5.tar.gz
micropython-13c5a228c9ec9881087bdddd162f3b633edc3aa5.zip
docs/esp8266: Update quickref and tutorial for OneWire/DS18X20 driver.
Diffstat (limited to 'docs/esp8266/tutorial')
-rw-r--r--docs/esp8266/tutorial/onewire.rst6
1 files changed, 3 insertions, 3 deletions
diff --git a/docs/esp8266/tutorial/onewire.rst b/docs/esp8266/tutorial/onewire.rst
index c90044b7a8..c2cede9e38 100644
--- a/docs/esp8266/tutorial/onewire.rst
+++ b/docs/esp8266/tutorial/onewire.rst
@@ -6,19 +6,19 @@ The 1-wire bus is a serial bus that uses just a single wire for communication
is a very popular 1-wire device, and here we show how to use the onewire module
to read from such a device.
-For the following code to work you need to have at least one DS18B20 temperature
+For the following code to work you need to have at least one DS18S20 or DS18B20 temperature
sensor with its data line connected to GPIO12. You must also power the sensors
and connect a 4.7k Ohm resistor between the data pin and the power pin. ::
import time
import machine
- import onewire
+ import onewire, ds18x20
# the device is on GPIO12
dat = machine.Pin(12)
# create the onewire object
- ds = onewire.DS18B20(onewire.OneWire(dat))
+ ds = ds18x20.DS18X20(onewire.OneWire(dat))
# scan for devices on the bus
roms = ds.scan()