summaryrefslogtreecommitdiffstatshomepage
path: root/docs/wipy/quickref.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/wipy/quickref.rst')
-rw-r--r--docs/wipy/quickref.rst7
1 files changed, 4 insertions, 3 deletions
diff --git a/docs/wipy/quickref.rst b/docs/wipy/quickref.rst
index 358020d94e..da895d7b30 100644
--- a/docs/wipy/quickref.rst
+++ b/docs/wipy/quickref.rst
@@ -28,14 +28,15 @@ See :ref:`pyb.Pin <pyb.Pin>`. ::
from pyb import Pin
# initialize GP2 in gpio mode (af=0) and make it an output
- p_out = Pin('GP2', af=0, mode=Pin.OUT)
+ p_out = Pin('GP2', mode=Pin.OUT)
p_out.high()
p_out.low()
p_out.toggle()
+ p_out(True)
# make GP1 an input with the pull-up enabled
- p_in = Pin('GP1', af = 0, mode=Pin.IN, type = Pin.STD_PU)
- p_in.value() # get value, 0 or 1
+ p_in = Pin('GP1', mode=Pin.IN, pull = Pin.PULL_UP)
+ p_in() # get value, 0 or 1
Timers
------