The first is that the pulseIn() function works with microseconds
and returns an unsigned long, which you are trying (unsuccessfully) to shoehorn into an int.
The first is that the pulseIn() function works with microseconds
and returns an unsigned long, which you are trying (unsuccessfully) to shoehorn into an int.