This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<SoftwareSerial.h> | |
SoftwareSerial GPRS(5, 6); | |
int buzzerPin = 8; //Pin number the buzzer is connected | |
int echoPin = 11; // Echo Pin of the ultrasonic sensor | |
int trigPin = 12; // Trigger Pin of the ultrasonic sensor | |
unsigned long previousMillis = 0; //This will be used to store the millisecnd value after each time the buzzer is triggered. This is used because delay function is not used for the buzzer timing. | |
int maxBeepInterval = 1000; //Max beep interval | |
int minBeebInterval = 300; //Min beep interval | |
int frequency = 1000; //Buzzer frequency in Hz | |
long distance; //Distance of the object from sensorlong echoTime; //Time taken for the echo |