void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Object distance");
}
void loop() {
// put your main code here, to run repeatedly:
delay(10); // this speeds up the simulation
pinMode(22, OUTPUT);
digitalWrite(22, LOW);
delay(2);
digitalWrite(22, HIGH);
delay(10);
pinMode(23, INPUT);
int x=pulseIn(23,HIGH);
float objdis=x*0.0165;
Serial.println(objdis);
}