diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2017-08-28 13:59:26 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-28 13:59:26 -0700 |
| commit | 447a4b1ecd5655357c9daaace03b91355d2e2c6d (patch) | |
| tree | 46ca08a93e9870aab4fbb533843f3c99796cbdf4 /docs/pyboard/tutorial/switch.rst | |
| parent | 4e63d55d8d0df6d7600bb684fa90a8cb54708ba8 (diff) | |
| parent | c679c80c710fd4a0e37ad87200d8a721e19727aa (diff) | |
Merge pull request #208 from adafruit/merge-v1.9.2
Merge MicroPython v1.9.2
Diffstat (limited to 'docs/pyboard/tutorial/switch.rst')
| -rw-r--r-- | docs/pyboard/tutorial/switch.rst | 8 |
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 ---------------- |
