Wowwee MIP V2 icon Wowwee MIP V2 UART interface to hack WowWee MIP with ESP32/ESP32‑Cam or EZ‑B v4 for ARC; hardware UART preferred, configurable power and baud 9600/115200 Try it →
 

Waitforbetween

Ping.waitForBetween(triggerPort, echoPort, low, high, [ezbIndex])

Parameters

triggerPort Trigger port used by the ultrasonic distance sensor.
echoPort Echo port used by the ultrasonic distance sensor.
low Inclusive lower bound on value to wait for.
high Inclusive upper bound on value to wait for.
ezbIndex (optional) Board index of the EZB to use.

Returns

The value measured from the ultrasonic distance sensor that is between low and high as a number between 0 and 255.

Description

Suspends execution of the script until the value read from the ultrasonic distance sensor is between low (inclusvie) and high (inclusive). The value read from the ultrasonic distance sensor is returned when the script resumes execution.