pyb.Switch ========== .. This document was autogenerated by Sphinx-autoapi from a .pyi stub or a source code file. .. Do not edit this file, instead edit the source file and run Sphinx to update. .. Source: docs/stubs/pyb/Switch.pyi .. py:module:: pyb.Switch Classes ------- .. autoapisummary:: pyb.Switch.Switch Module Contents --------------- .. py:class:: Switch Bases: :py:obj:`pyb.Pin.Pin` Create and return a switch object. .. py:method:: __call__() -> _typeshed.Incomplete Call switch object directly to get its state: ``True`` if pressed down, ``False`` otherwise. .. py:method:: callback(fun) -> None Register the given function to be called when the switch is pressed down. If ``fun`` is ``None``, then it disables the callback. .. py:method:: value() -> bool Get the switch state. Returns ``True`` if pressed down, otherwise ``False``.