#include <HCSR04.h>
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
HCSR04 hc(A1, A0);
void setup()
{
lcd.begin(16, 2); // put your setup code here, to run once:
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("ultrasonic Sensor");
Serial.begin(9600);
}
void loop() {
Serial.print(hc.dist()); // put your main code here, to run repeatedly:
int d =hc.dist();
lcd.setCursor(0, 1);
lcd.print(" ");
lcd.setCursor(0, 1);
lcd.print(d);
delay(1000);
}