Skip to content

Commit 272a5d9

Browse files
committed
docs/esp8266: Consistently replace Pin.high/low methods with .on/off.
1 parent d5b8825 commit 272a5d9

File tree

3 files changed

+9
-8
lines changed

3 files changed

+9
-8
lines changed

docs/esp8266/quickref.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ Use the :ref:`machine.Pin <machine.Pin>` class::
107107
from machine import Pin
108108

109109
p0 = Pin(0, Pin.OUT) # create output pin on GPIO0
110-
p0.high() # set pin to high
111-
p0.low() # set pin to low
110+
p0.on() # turn on pin, set to high
111+
p0.off() # turn off pin, set to low
112112
p0.value(1) # set pin to high
113113

114114
p2 = Pin(2, Pin.IN) # create input pin on GPIO2

docs/esp8266/tutorial/pins.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ Then set its value using::
3535

3636
Or::
3737

38-
>>> pin.low()
39-
>>> pin.high()
38+
>>> pin.off()
39+
>>> pin.on()
4040

4141
External interrupts
4242
-------------------

docs/esp8266/tutorial/repl.rst

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,12 @@ turn it on and off using the following code::
101101

102102
>>> import machine
103103
>>> pin = machine.Pin(2, machine.Pin.OUT)
104-
>>> pin.high()
105-
>>> pin.low()
104+
>>> pin.on()
105+
>>> pin.off()
106106

107-
Note that ``high`` might turn the LED off and ``low`` might turn it on (or vice
108-
versa), depending on how the LED is wired on your board.
107+
Note that ``on`` method of a Pin might turn the LED off and ``off`` might
108+
turn it on (or vice versa), depending on how the LED is wired on your board.
109+
To resolve this, machine.Signal class is provided.
109110

110111
Line editing
111112
~~~~~~~~~~~~

0 commit comments

Comments
 (0)