Third eye for blind

Arduino code:

#define trigPin 13

#define echoPin 12

#define motor 7

#define buzzer 6

void setup()
{
pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(motor, OUTPUT);

pinMode(buzzer,OUTPUT);

}

void loop()

{

long duration, distance;

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

duration = pulseIn(echoPin, HIGH);

distance = (duration/2) / 29.1;

if (distance < 70)     // This is where checking the distance you can change the value

{

digitalWrite(motor,HIGH);    // When the the distance below 100cm

digitalWrite(buzzer,HIGH);

} else

{

digitalWrite(motor,LOW);     // when greater than 100cm

digitalWrite(buzzer,LOW);

} delay(500);

}

Post a Comment

16 Comments

  1. Hello bro,,,, kya ap muje srif code de sagteho plz

    ReplyDelete
    Replies
    1. Okay message me on insta username innovative ideas yt

      Delete
    2. Please give me the code only

      Delete
    3. Bhai maine bhi dm kra h plz reply mujhe parso submit krrna h

      Delete
  2. Bhaiya plese Arduino mini ka bhi coonection samza do please

    ReplyDelete
  3. Can you give me the code only file?

    ReplyDelete
  4. Bhai code kaha Hai mill
    nahi Raha hai

    ReplyDelete
  5. Bhai buzza ki jangha vibration moter fit kare to coding me kya change aaya ga

    ReplyDelete
    Replies
    1. Kuch nhi bs positive wali wire vibration motor ki buzzer ki positive wali wire ki jagah lga dena

      Delete
  6. Please give me a circuit diagram

    ReplyDelete
  7. Code error bata raha hai
    Kya karu

    ReplyDelete