URM37 V4.0 Ultrasonic Sensor
In the above code, you may not get the distance like 500cm, for we just set it like 450cm.This is just
a basic demo, after this, we will dive deeper to find more about it. Note: reverse the code”#define
Measure 1 ” to “#define Measure 0”, and it can read the distance by analog value.
NOTE
: PWM trigger mode support multiple parallel modules.
Auto Measure Mode
By means of the computer software or MCU Module, write 0xAA to 0x02 address to switch to
automatic measurement mode. Writting a 8-bit 16 binary data to 0x04 address to reverse the
measure time interval.
This module measures distance automatically every 25 ms (Settable) , then compare the data with
the set value, if equal to or less than the set value, COMP/TRIG pin output low. In addition, in every
measure,the PWM Terminal will read the distance as a low level pulse, 50uS represents 1 cm.
Tips
:if you have set the Compare value, you could use this module as a Ultrasonic Switch.