A PXT package for Seeed Studio Grove - Ultrasonic Ranger, see https://www.seeedstudio.com/Grove-Ultrasonic-Ranger-p-960.html
// Measure distance in centimeters, specify the signal pin
let distance = Grove_Ultrasonic_Ranger.measureInCentimeters(DigitalPin.P0);
// Measure distance in inches, specify the signal pin
let distance = Grove_Ultrasonic_Ranger.measureInInches(DigitalPin.P0);
MIT