summaryrefslogtreecommitdiff
path: root/docs/pyboard/tutorial/switch.rst
diff options
context:
space:
mode:
authorDan Halbert <halbert@halwitz.org>2017-08-25 22:17:07 -0400
committerDan Halbert <halbert@halwitz.org>2017-08-25 22:17:07 -0400
commitef61b5ecb59e9b4e37e3e3c023c62d583c23eb16 (patch)
tree45a798fbed0dc673304597b29e0b60174195ce79 /docs/pyboard/tutorial/switch.rst
parent266be307770abe11c220eb493388807920914b7a (diff)
parent1f78e7a43130acfa4bedf16c1007a1b0f37c75c3 (diff)
Initial merge of micropython v1.9.2 into circuitpython 2.0.0 (in development) master.
cpx build compiles and loads and works in repl; test suite not run yet esp8266 not tested yet
Diffstat (limited to 'docs/pyboard/tutorial/switch.rst')
-rw-r--r--docs/pyboard/tutorial/switch.rst8
1 files changed, 7 insertions, 1 deletions
diff --git a/docs/pyboard/tutorial/switch.rst b/docs/pyboard/tutorial/switch.rst
index 945e89aa0..91683fba4 100644
--- a/docs/pyboard/tutorial/switch.rst
+++ b/docs/pyboard/tutorial/switch.rst
@@ -15,12 +15,18 @@ the name ``pyb`` does not exist.
With the switch object you can get its status::
- >>> sw()
+ >>> sw.value()
False
This will print ``False`` if the switch is not held, or ``True`` if it is held.
Try holding the USR switch down while running the above command.
+There is also a shorthand notation to get the switch status, by "calling" the
+switch object::
+
+ >>> sw()
+ False
+
Switch callbacks
----------------