Recorder icon Recorder — Record and replay EZB communications (servo & digital commands) with forward/reverse playback, save recordings and trigger them from scripts Try it →
 

Waitforlower

Ping.waitForLower(triggerPort, echoPort, distance, [ezbIndex])

Parameters

triggerPort Trigger port used by the ultrasonic distance sensor.
echoPort Echo port used by the ultrasonic distance sensor.
distance Exclusive 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 lower than distance as a number between 0 and 255.

Description

Suspends execution of the script until the value read from the ultrasonic distance sensor is lower than distance. The value read from the ultrasonic distance sensor is returned when the script resumes execution.