Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
272a5d95
Commit
272a5d95
authored
May 30, 2017
by
Paul Sokolovsky
Browse files
docs/esp8266: Consistently replace Pin.high/low methods with .on/off.
parent
d5b8825d
Changes
3
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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