I need to drive a vibrator motor such as this https://www.pjrc.com/teensy/td_pulse.html at a constant frequency of say 50 cps but be able to control the intensity of vibration within a range between zero and some maximum amount. The intensity should be able to vary in real time based on some other variable such as an ADC input.
I know the the way to control the intensity of a vibrator motor is with PWM much like a loudspeaker. I plan to use a transistor to increase the drive current.
I assume the tone(pin, frequency) function would produce a vibration at a given frequency, but how can the intensity of the tone be controlled while keeping the frequency constant?
This is with a Teensy 3.2.
I know the the way to control the intensity of a vibrator motor is with PWM much like a loudspeaker. I plan to use a transistor to increase the drive current.
I assume the tone(pin, frequency) function would produce a vibration at a given frequency, but how can the intensity of the tone be controlled while keeping the frequency constant?
This is with a Teensy 3.2.