summaryrefslogtreecommitdiffstatshomepage
path: root/docs/esp8266/tutorial/pins.rst
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2016-05-03 13:56:15 +0100
committerDamien George <damien.p.george@gmail.com>2016-05-03 13:56:15 +0100
commit8af64bcf2b9443bcc7039566e02aa5cd7592b3db (patch)
treede83a945b6cc815eb6ec9719e7226a45c59f9d42 /docs/esp8266/tutorial/pins.rst
parent5036b6ad1822ea701085f17959d787ed103ac737 (diff)
downloadmicropython-8af64bcf2b9443bcc7039566e02aa5cd7592b3db.tar.gz
micropython-8af64bcf2b9443bcc7039566e02aa5cd7592b3db.zip
docs/esp8266/tutorial: Update pins tutorial to reflect changes in API.
Diffstat (limited to 'docs/esp8266/tutorial/pins.rst')
-rw-r--r--docs/esp8266/tutorial/pins.rst10
1 files changed, 5 insertions, 5 deletions
diff --git a/docs/esp8266/tutorial/pins.rst b/docs/esp8266/tutorial/pins.rst
index 8ba4516273..639267d2ee 100644
--- a/docs/esp8266/tutorial/pins.rst
+++ b/docs/esp8266/tutorial/pins.rst
@@ -16,9 +16,9 @@ it. To make an input pin use::
>>> pin = machine.Pin(0, machine.Pin.OUT, machine.Pin.PULL_UP)
-You can either use PULL_UP or PULL_NONE for the input pull-mode. If it's
-not specified then it defaults to PULL_NONE. You can read the value on
-the pin using::
+You can either use PULL_UP or None for the input pull-mode. If it's
+not specified then it defaults to None, which is no pull resistor.
+You can read the value on the pin using::
>>> pin.value()
0
@@ -61,8 +61,8 @@ Next we will create two pins and configure them as inputs::
An finally we need to tell the pins when to trigger, and the function to call
when they detect an event::
- >>> p0.irq(Pin.IRQ_FALLING, callback)
- >>> p2.irq(Pin.IRQ_RISING | Pin.IRQ_FALLING, callback)
+ >>> p0.irq(trigger=Pin.IRQ_FALLING, handler=callback)
+ >>> p2.irq(trigger=Pin.IRQ_RISING | Pin.IRQ_FALLING, handler=callback)
We set pin 0 to trigger only on a falling edge of the input (when it goes from
high to low), and set pin 2 to trigger on both a rising and falling edge. After