summaryrefslogtreecommitdiff
path: root/docs/pyboard/tutorial/switch.rst
diff options
context:
space:
mode:
authorDaniel Tralamazza <daniel@tralamazza.com>2017-08-08 00:45:58 +0200
committerDaniel Tralamazza <daniel@tralamazza.com>2017-08-08 00:45:58 +0200
commitb53b6913147bdee5aef1b54f7728d44580dd0935 (patch)
treecfbfad1ddf3ef386131ec5a39961be70d4b60398 /docs/pyboard/tutorial/switch.rst
parent3e0d3d283d5619e52e04dc8484d7bf413e66d130 (diff)
parent6c55cdafa32e4db9e2aaf08b1ec597b4723721ea (diff)
Merge remote-tracking branch 'upstream/master'
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
----------------