Haptic Feedback Module: 3V - 5V
Control this Mini Vibrating Motor Disc from an Arduino or other microcontroller via PWM! 3 Pins: Power 3 to 5V, Ground 0V and IN which takes PWM input from any microcontroller. Motor included directly on the board!
Categories
Newsletter
Control this Mini Vibrating Motor Disc from an Arduino or other microcontroller via PWM! 3 Pins: Power 3 to 5V, Ground 0V and IN which takes PWM input from any microcontroller. Motor included directly on the board!
Control this Mini Vibrating Motor Disc from an Arduino or other microcontroller via PWM! 3 Pins: Power 3 to 5V, Ground 0V and IN which takes PWM input from any microcontroller. Motor included directly on the board!
Specification:
/*
Haptic Feedback Module Arduino Sample Code
Connection Diagram:
Arduino GND -> Module GND
Arduino 5V -> Module VCC
Arduino Pin 9 -> Module VIN
*/
int VinPin = 9; //The signal input pin VIN is connected to pin 9 on the Arduino
void setup()
{
pinMode(VinPin, OUTPUT);
}
void loop()
{
//Turn ON to the highest setting for 1 second, then OFF for 1 second
digitalWrite(VinPin, HIGH); //vibrate on max
delay(1000); // delay one second
digitalWrite(VinPin, LOW); //stop vibrating
delay(1000); //wait one second.
// Pulse gradually, intensity rises and falls
// Fade on
for(int strengthVal = 0; strengthVal <= 255; strengthVal +=1)
{
analogWrite(VinPin, strengthVal);
delay(15);
}
// Fade off
for(int strengthVal = 255; strengthVal >= 0; strengthVal -=1)
{
analogWrite(VinPin, strengthVal);
delay(15);
}
delay(1000); //wait one second
}