• Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors
HomeArduinoSensors Kit for ArduinoKY033: Line follow Sensor Module
Previous Next

KY033: Line follow Sensor Module

Posted by: admin , April 25, 2014

Use the LED comes with digital pin 13, and connect the shock sensor output to digital pin 3, when the shock sensor senses vibration, LED will blink.

int Led=13;

int Shock=3

int val;

void setup()

{

pinMode(Led,OUTPUT);

pinMode(Shock,INPUT);//

}

void loop()

{

val=digitalRead(Shock);

if(val==HIGH)/

{

digitalWrite(Led,LOW);

}

else

{

digitalWrite(Led,HIGH);

}

}

Tags: Sensors Kit for Arduino

Share!
Tweet

admin

About the author

Leave a Reply Cancel reply

You must be logged in to post a comment.

Category

  • Home
  • pcDuino
  • WiKi
  • Store
  • Distributors