Arduino Tutorial #13 Tilt sensor as an impact sensor with arduino.
Scroll down for code.....
Please like & Subscribe for more videos
If you want to support my video please buy any product through my amazon affiliate link. I will receive a commission, at no extra cost to you.
LIST OF COMPONENT (affiliate links)
[ Ссылка ] (Arduino)
[ Ссылка ] (Tilt sensor)
[ Ссылка ] (Breadboard)
[ Ссылка ] (Jumper wire)
[ Ссылка ] (LED)
int LED = 13;
int Tilt_sensor = 2;
int val = 0;
void setup(){
pinMode (LED,OUTPUT);
pinMode (Tilt_sensor,INPUT);
}
void loop(){
val = digitalRead(Tilt_sensor);
if (val == HIGH){
digitalWrite(LED,HIGH);
delay(500);
}
else {
digitalWrite(LED,LOW);
}
delay(100);
}
Ещё видео!