Custom Movement Panel V2 icon Custom Movement Panel V2 Custom Movement V2 panel for ARC: scripts for F/R/L, Reverse, roll left/right, up/down with speed mapping to PWM for drones, mecanum & custom drives Try it →
 

Waitforequals

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

Parameters

triggerPort Trigger port used by the ultrasonic distance sensor.
echoPort Echo port used by the ultrasonic distance sensor.
distance Value to wait for.
ezbIndex (optional) Board index of the EZB to use.

Returns

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

Description

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