int trigPin=23;
int echoPin=22;
long duration;
int distance;
void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
pinMode(trigPin, OUTPUT);
pinMode(echoPin, INPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  ultrasonic();
  delay(1000); // this speeds up the simulation
}
void ultrasonic(){
  digitalWrite(trigPin, LOW);
  delay(2);
  digitalWrite(trigPin, HIGH);
  delay(10);
  digitalWrite(trigPin, LOW);
  duration=pulseIn(echoPin,HIGH);
  distance=duration*0.034/2;
  Serial.print("Distance: ");
  Serial.println(distance);
}