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
272a5d95
Commit
272a5d95
authored
May 30, 2017
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs/esp8266: Consistently replace Pin.high/low methods with .on/off.
parent
d5b8825d
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
8 deletions
+9
-8
docs/esp8266/quickref.rst
docs/esp8266/quickref.rst
+2
-2
docs/esp8266/tutorial/pins.rst
docs/esp8266/tutorial/pins.rst
+2
-2
docs/esp8266/tutorial/repl.rst
docs/esp8266/tutorial/repl.rst
+5
-4
No files found.
docs/esp8266/quickref.rst
View file @
272a5d95
...
...
@@ -107,8 +107,8 @@ Use the :ref:`machine.Pin <machine.Pin>` class::
from machine import Pin
p0 = Pin(0, Pin.OUT) # create output pin on GPIO0
p0.
high() # set pin
to high
p0.
low() # set pin
to low
p0.
on() # turn on pin, set
to high
p0.
off() # turn off pin, set
to low
p0.value(1) # set pin to high
p2 = Pin(2, Pin.IN) # create input pin on GPIO2
...
...
docs/esp8266/tutorial/pins.rst
View file @
272a5d95
...
...
@@ -35,8 +35,8 @@ Then set its value using::
Or::
>>> pin.
low
()
>>> pin.
high
()
>>> pin.
off
()
>>> pin.
on
()
External interrupts
-------------------
...
...
docs/esp8266/tutorial/repl.rst
View file @
272a5d95
...
...
@@ -101,11 +101,12 @@ turn it on and off using the following code::
>>> import machine
>>> pin = machine.Pin(2, machine.Pin.OUT)
>>> pin.
high
()
>>> pin.
low
()
>>> pin.
on
()
>>> pin.
off
()
Note that ``high`` might turn the LED off and ``low`` might turn it on (or vice
versa), depending on how the LED is wired on your board.
Note that ``on`` method of a Pin might turn the LED off and ``off`` might
turn it on (or vice versa), depending on how the LED is wired on your board.
To resolve this, machine.Signal class is provided.
Line editing
~~~~~~~~~~~~
...
...
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