Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
8af64bcf
Commit
8af64bcf
authored
May 03, 2016
by
Damien George
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs/esp8266/tutorial: Update pins tutorial to reflect changes in API.
parent
5036b6ad
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
docs/esp8266/tutorial/pins.rst
docs/esp8266/tutorial/pins.rst
+5
-5
No files found.
docs/esp8266/tutorial/pins.rst
View file @
8af64bcf
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment