From 5a68588dbd2535869cd001174fe83e7ebc6724f9 Mon Sep 17 00:00:00 2001 From: Rahix <rahix@rahix.de> Date: Wed, 17 Jul 2019 21:44:48 +0200 Subject: [PATCH] docs: Document `vibra` module Signed-off-by: Rahix <rahix@rahix.de> --- Documentation/index.rst | 1 + Documentation/pycardium/vibra.rst | 30 ++++++++++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 Documentation/pycardium/vibra.rst diff --git a/Documentation/index.rst b/Documentation/index.rst index 6a644721..1cbba07d 100644 --- a/Documentation/index.rst +++ b/Documentation/index.rst @@ -23,6 +23,7 @@ Last but not least, if you want to start hacking the lower-level firmware, the pycardium/overview pycardium/color pycardium/leds + pycardium/vibra .. toctree:: :maxdepth: 1 diff --git a/Documentation/pycardium/vibra.rst b/Documentation/pycardium/vibra.rst new file mode 100644 index 00000000..096e200c --- /dev/null +++ b/Documentation/pycardium/vibra.rst @@ -0,0 +1,30 @@ +``vibra`` - Vibration Motor +=========================== + +.. py:function:: vibra.vibrate(millis) + + Turn on the vibration motor for a certain duration. + + **Example**: + + .. code-block:: python + + import vibra + + # Turn on vibration motor for 60 ms + vibra.vibrate(60) + + :param int millis: Duration for the vibration motor to be on. + + +.. py:function:: vibra.set(state) + + Permanently set the state of the vibration motor to either *on* or *off*. + + .. warning:: + + If your code for some reason crashes between turning the motor on and + back off again, the motor will continue running. Consider using + :py:func:`vibra.vibrate` instead. + + :param bool state: ``True`` to turn on, ``False`` to turn the motor off. -- GitLab