waitForBetween

ADC.waitForBetween(port, low, high, [frequencyMs], [ezbIndex])

Parameters

port Analog port to read from.
low Inclusive lower bound on value to wait for.
high Inclusive upper bound on value to wait for.
frequencyMs (optional) How often the ADC port is checked in milliseconds.
ezbIndex (optional) Board index of the EZB to read from.

Returns

The value read from the specified ADC port that is between or low and high.

Description

Suspends execution of the script until the value read from the specified ADC port is between low (inclusive) and high (inclusive). The value read from the ADC port ranges between 0 and 255. If frequencyMs is provided the port is checked every frequencyMs milliseconds. Otherwise the port is checked as often as possible.