A simple haptic feedback motor driver module for micropython.
- LILYGO T-Watch
A simple haptic feedback motor driver module. Control the motor through pwm and timer to simulate the effect of haptic feedback.
Usage Model:
from machine import Pin
from haptic import Haptic
touch = Pin(38, Pin.IN)
h = Haptic(Pin(4))
while True:
if touch.value() == 0:
h.once()
使用以下参数构造并返回一个新的 Haptic 对象:
- pin: pin is the entity on which the PWM is output, which is usually a machine.Pin object.
- freq: Frequency of PWM output
Play the haptic effect once on the motor.
- duration: The duration of the haptic effect, in milliseconds.
Disabled Haptic Driver.