This small vibrator motor can vibrate like your phone. When using it, you only need to power for the module and then send "Vibration" command. In fact, the "Vibration" command is setting control pins to high level, then it will work. I like this module because it can create a short-term shock to prompt me whether one operation was successful, such as shaking my arm to switch my iPhone songs, which sounds terrible, but it does not like the buzzer.
Here is a Demo Code showing how to turn on the vibration motor.
Hardware Installation:
Note: when connect Xadow Vibrator Motor to Xadow Main Board, you should concern about the connection direction. The connection method is that the unfilled corner of one Xadow module need to connect to the right angle of another module(see four corners of each Xadow module).
Demo code like this:
void setup() { DDRF |= 0x01; DDRB |= 0x04; } void loop() { //turn on the vibration motor PORTF |= 0x01; PORTB |= 0x04; delay(1000); //turn off the vibration motor PORTF &= ~(0x01); PORTB |= 0x04; delay(1000); //turn on the vibration motor PORTF |= 0x01; PORTB |= 0x04; delay(1000); //turn off the vibration motor PORTF |= 0x01; PORTB &= ~(0x04); delay(1000); //turn on the vibration motor PORTF |= 0x01; PORTB |= 0x04; delay(1000); //turn off the vibration motor PORTF &= ~(0x01); PORTB &= ~(0x04); delay(1000); }
Xadow Vibrator Motor Eagle File