Sharp IR Radar icon Sharp IR Radar Radar-style Sharp IR scanner for EZB ADC: sweeps sensor, displays distance dots, logs ADC voltage, and can steer/avoid obstacles via Movement Panel 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.