Commit 22ca5390 authored by Paul Sokolovsky's avatar Paul Sokolovsky

docs/esp8266/quickref: Polish Pin.on()/off() examples.

parent 7400d887
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment