Stick for blind person

I am beginner in arduino and i want to make a stick for blind person which gives sound from buzzer when something is there in front of
Ultrasonic sensor

// defines pins numbers
const int trigPin = 9;
const int echoPin = 10;
const int buzzer = 11;
const int ledPin = 13;

// defines variables
long duration;
int distance;
int safetyDistance;

void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(buzzer, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600); // Starts the serial communication
}

void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculating the distance
distance= duration*0.034/2;

safetyDistance = distance;
if (safetyDistance <= 5){
digitalWrite(buzzer, HIGH);
digitalWrite(ledPin, HIGH);
}
else{
digitalWrite(buzzer, LOW);
digitalWrite(ledPin, LOW);
}

// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance);
}

code as ------^

error=====
Variables and constants in RAM (global, static), used 28176 / 80192 bytes (35%)
║ SEGMENT BYTES DESCRIPTION
╠══ DATA 1496 initialized variables
╠══ RODATA 936 constants
╚══ BSS 25744 zeroed variables
. Instruction RAM (IRAM_ATTR, ICACHE_RAM_ATTR), used 60363 / 65536 bytes (92%)
║ SEGMENT BYTES DESCRIPTION
╠══ ICACHE 32768 reserved space for flash instruction cache
╚══ IRAM 27595 code in IRAM
. Code in flash (default, ICACHE_FLASH_ATTR), used 236388 / 1048576 bytes (22%)
║ SEGMENT BYTES DESCRIPTION
╚══ IROM 236388 code in flash
esptool.py v3.0
Serial port COM12
Connecting......................................____
A fatal esptool.py error occurred: Failed to connect to ESP8266: Timed out waiting for packet header_

Hello dev767

Take a search engine of your choice and ask the WWW for ' A fatal esptool.py error occurred: Failed to connect to ESP8266'.

Hello @paulpaulson

I have tried but as i m beginner so I m not able to find an solution

Which esp8266 board are you using? (NodeMCU, WeMos D1 Mini, etc.)

Are you sure that you selected the correct serial port?

Does it work when you upload a basic "blink" program?

Please post the error message in code tags like this:

```
Error here
```

(Also, do not press the solution button until your problem has been solved. Then you will get more help and more people helping you.)

looks like an upload problem

which Tools->board and Tools->port did you specify?

Com12

Hi,
What OS and version of the IDE are you using?

Have you been able to upload to it previously?

Can you please post some images of your project so we can see your component layout?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

???

Are you certain that this is the correct port?

Are there any connections made to the board? If so, please send a schematic

Which board are you using and which board have you selected?


Hi, @dev767
When you select COM 12, are there any other comports listed?

Does your tools tab look like this?
What version of the IDE are you using?
What is your Operating System.

Have you been able to program and upload to this UNO before, and/or other Arduino controllers.

Tom... :smiley: :+1: :coffee: :australia:

Thanks...Tom.. :smiley: :+1: :coffee: :australia:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.