Skip to content
Snippets Groups Projects
Commit 5c292f80 authored by norpol's avatar norpol
Browse files

Improve documentation

parent ef63e6ff
No related branches found
No related tags found
No related merge requests found
...@@ -2,12 +2,12 @@ import vibra ...@@ -2,12 +2,12 @@ import vibra
import utime import utime
def vibrate(times=None, dur=None, sle=None): def vibrate(times=None, duration=None, sleep=None):
""" """
trigger vibration motor with three values trigger vibration motor with three values
times => how often we should triger :param int times: how often we should trigger
dur => how long should we trigger for each iteration :param int duration: how long should we trigger for each iteration (ms)
sle => how long should we wait in between :param int sleep: how long should we wait in between (ms)
combination out of this creates a fake PWM combination out of this creates a fake PWM
that enables easy and smooth vibrations that enables easy and smooth vibrations
...@@ -15,8 +15,8 @@ def vibrate(times=None, dur=None, sle=None): ...@@ -15,8 +15,8 @@ def vibrate(times=None, dur=None, sle=None):
times = times or 1 times = times or 1
for i in range(times): for i in range(times):
vibra.vibrate(dur) vibra.vibrate(duration)
utime.sleep_ms(sle) utime.sleep_ms(sleep)
def simple(): def simple():
...@@ -37,9 +37,11 @@ def select(): ...@@ -37,9 +37,11 @@ def select():
def pattern(n=None): def pattern(n=None):
""" """
:param int n: how often to repeat the pattern
n = 2 and n = 1 feels the same
very distinctive but long pattern very distinctive but long pattern
feels like duk-duk-duk feels like duk-duk-duk
n = 2 and n = 1 feels the same
""" """
n = n or 3 n = n or 3
vibrate(n, 20, 100) vibrate(n, 20, 100)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment