https://www.picz.in.th/image/Y57Ii8
It always return 1149.
Is it broken , is there anyway to fix it
this is my code
https://www.picz.in.th/image/Y57Ii8
It always return 1149.
Is it broken , is there anyway to fix it
this is my code
You only read the sensor once and that is before setup() so the result of the reading is suspect. Try reading the sensor in the loop() function.
void loop() {
delay(50);
int d = sonar.ping_cm();
Serial.println(d);
}
THX alot guy why did forget about that