BUZZER FOR BLIND PEOPLE

Buzzer blind1

The code can be downloaded at:

https://github.com/triantara/ARDUINO-TRIANTARA/blob/main/BUZZER%20FOR%20BLIND.zip

const int buzzer = 6; //buzzer to arduino pin 6
#include <Wire.h>
#include <VL53L0X.h>
int a;
int b;
VL53L0X sensor;

void setup(){
Serial.begin(9600);
Wire.begin();
sensor.init();
sensor.setTimeout(500);
pinMode(buzzer, OUTPUT); // Set buzzer – pin 6 as an output
sensor.startContinuous();
}

void loop(){
a=sensor.readRangeContinuousMillimeters();
Serial.println(a/10);
if(a<1200){
int b = map(a, 0, 1200, 0, 200);
tone(buzzer, 1000); // Send 1KHz sound signal…
delay(b);
noTone(buzzer); // Stop sound…
delay(b);
}

else{
noTone(buzzer);
}

}