#include <LiquidCrystal.h>
#include <NewPing.h>
#define TRIGGER_PIN 4
#define ECHO_PIN 5
#define MAX_DISTANCE 200
NewPing sonar(TRIGGER_PIN,ECHO_PIN,MAX_DISTANCE);
LiquidCrystal lcd(12, 11, 10, 9, 8, 7);
void setup() {
Serial.begin(9600);
//display
lcd.begin(16, 2);
// you can now interact with the LCD, e.g.:
lcd.print("Test123");
}
void loop() {
//Ultraschallsensor
delay(500);
unsigned int uS=sonar.ping();
Serial.print("Ping: ");
Serial.print(uS /US_ROUNDTRIP_CM);
Serial.println("cm");
//Display
}