int trig = 7;
int echo = 6;
float distance;
void setup() {
Serial.begin(115200);
pinMode(trig, OUTPUT);
pinMode(echo, INPUT);
}
void loop() {
digitalWrite(trig, HIGH);
delayMicroseconds(10);
digitalWrite(trig, LOW);
int duration = pulseIn(echo, HIGH);
Serial.print("CM: ");
Serial.println(duration / 58);
delay(1000);
}