Datasheet
5
4. Usage
4.1 With Arduino
To make it vibrate is just as easy as to turn on an LED. Here is an example showing how to turn
on the vibration motor.
1. Plug it onto the Digital port 9 of Grove - Base Shield using a Grove cable.
2. Plug the Grove - Base Shield onto Arduino.
3. Connect Arduino to PC by using a USB cable.
4. Copy and paste code below to a new Arduino sketch, and upload it to your Arduino. Please
click here if you do not know how to upload.
Demo code like:
int MoPin = 9; // vibrator Grove connected to digital pin 9
void setup() {
pinMode( MoPin, OUTPUT );
}
void loop() {
digitalWrite(MoPin, HIGH);
delay(1000);
digitalWrite(MoPin, LOW);
delay(1000);
}
}