Arduino 各种模块篇 震动模块 vibrator

vibrator is a good thing. it has multi-funtionality . :)

Now the  vibrator we choose is the one which looks like this:

http://www.seeedstudio.com/wiki/Grove_-_Vibrator

I am testing this vibrator which is neat.

Gvib.jpg

 

const int vibratorPin = 8;


void setup()
{
  pinMode(vibratorPin, OUTPUT);
}

void loop()
{
  // make it vibrate
  digitalWrite(vibratorPin,HIGH);
  delay(1000);
  // make it not vibrate
  digitalWrite(vibratorPin,LOW);
  delay(1000);
}

make it run!

 

then you will see it vibrate every 1 sec.

 

posted @ 2013-10-10 11:29  spaceship9  阅读(416)  评论(0编辑  收藏  举报