Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
micropython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
micropython
Commits
22ca5390
Commit
22ca5390
authored
May 31, 2017
by
Paul Sokolovsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
docs/esp8266/quickref: Polish Pin.on()/off() examples.
parent
7400d887
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
docs/esp8266/quickref.rst
docs/esp8266/quickref.rst
+3
-3
No files found.
docs/esp8266/quickref.rst
View file @
22ca5390
...
@@ -107,9 +107,9 @@ Use the :ref:`machine.Pin <machine.Pin>` class::
...
@@ -107,9 +107,9 @@ Use the :ref:`machine.Pin <machine.Pin>` class::
from machine import Pin
from machine import Pin
p0 = Pin(0, Pin.OUT) # create output pin on GPIO0
p0 = Pin(0, Pin.OUT) # create output pin on GPIO0
p0.on() #
turn on pin, set to high
p0.on() #
set pin to "on" (high) level
p0.off() #
turn off pin, set to low
p0.off() #
set pin to "off" (low) level
p0.value(1) # set pin to high
p0.value(1) # set pin to
on/
high
p2 = Pin(2, Pin.IN) # create input pin on GPIO2
p2 = Pin(2, Pin.IN) # create input pin on GPIO2
print(p2.value()) # get value, 0 or 1
print(p2.value()) # get value, 0 or 1
...
...
Write
Preview
Markdown
is supported
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