vibra - Vibration Motor

vibra.vibrate(millis)

Turn on the vibration motor for a certain duration.

Example:

import vibra

# Turn on vibration motor for 60 ms
vibra.vibrate(60)
Parameters

millis (int) – Duration for the vibration motor to be on.

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 vibra.vibrate() instead.

Parameters

state (bool) – True to turn on, False to turn the motor off.