docs/esp8266/quickref: Polish Pin.on()/off() examples.
This commit is contained in:
parent
7400d88762
commit
22ca5390f7
@ -107,9 +107,9 @@ Use the :ref:`machine.Pin <machine.Pin>` class::
|
||||
from machine import Pin
|
||||
|
||||
p0 = Pin(0, Pin.OUT) # create output pin on GPIO0
|
||||
p0.on() # turn on pin, set to high
|
||||
p0.off() # turn off pin, set to low
|
||||
p0.value(1) # set pin to high
|
||||
p0.on() # set pin to "on" (high) level
|
||||
p0.off() # set pin to "off" (low) level
|
||||
p0.value(1) # set pin to on/high
|
||||
|
||||
p2 = Pin(2, Pin.IN) # create input pin on GPIO2
|
||||
print(p2.value()) # get value, 0 or 1
|
||||
|
Loading…
x
Reference in New Issue
Block a user