Smart Blind stick Code
Code
int trigpin = 4;
int echopin = 5;
int buzzer= 3;
long duration;
int distance;
void setup()
{
pinMode(3,OUTPUT);
pinMode(trigpin, OUTPUT);
pinMode(echopin, INPUT);
}
void loop()
{
digitalWrite(trigpin, LOW);
delayMicroseconds(2);
digitalWrite(trigpin, HIGH);
delayMicroseconds(10);
digitalWrite(trigpin, LOW);
duration = pulseIn(echopin, HIGH);
distance = duration*0.034/2;
Serial.print("Distance: ");
Serial.println(distance);
if(distance<30)
{
digitalWrite(3, HIGH);
}
else
{
digitalWrite(3, LOW);
}
}
Galay
ReplyDeletenice
ReplyDeleteBuzzer=3 kyo dala hai
ReplyDeleteWill sell that sir
ReplyDeleteGood Post. I like your blog. Thanks for Sharing.
ReplyDeleteIndustrial Training Institute in Noida
sirrr kam nahi kar rha hai
ReplyDeleteSir please send your mobile number .
ReplyDeletesirrr kam nahi kar rha hai
ReplyDeleteNihi aga
ReplyDeleteKuch bi Nahi Aya
ReplyDeleteIsme pulseln isme L ke jagah capital i RAHEGA
ReplyDeletedoes work????
ReplyDeletetell me
pls tell
DeleteIt's not working bro
ReplyDeleteWhy???
Delete