File tree Expand file tree Collapse file tree 3 files changed +9
-8
lines changed
Expand file tree Collapse file tree 3 files changed +9
-8
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -35,8 +35,8 @@ Then set its value using::
3535
3636Or::
3737
38- >>> pin.low ()
39- >>> pin.high ()
38+ >>> pin.off ()
39+ >>> pin.on ()
4040
4141External interrupts
4242-------------------
Original file line number Diff line number Diff 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
110111Line editing
111112~~~~~~~~~~~~
You can’t perform that action at this time.
0 commit comments