Skip to main content
added 90 characters in body
Source Link

Try with

unsigned int distance;

Instead of

int distance;

It could also be the motor shield that is using the same pins as your ultrasonic sensor.

Try with

unsigned int distance;

Instead of

int distance;

Try with

unsigned int distance;

Instead of

int distance;

It could also be the motor shield that is using the same pins as your ultrasonic sensor.

Source Link

Try with

unsigned int distance;

Instead of

int distance;