ARC Pro

Upgrade to ARC Pro

Your robot can be more than a simple automated machine with the power of ARC Pro!

setRandom

PWM.setRandom(port, lowCycle, highCycle, [ezbIndex])

Parameters

port Port to use.
lowCycle Inclusive lower bound on duty cycle percentage to set PWM duty cycle to.
highCycle Exclusive upper bound on duty cycle percentage to set PWM duty cycle to.
ezbIndex (optional) Board index of the EZB to get PWM duty cycle from.

Returns

The random value that the PWM was set to.

Description

Sets the PWM duty cycle percentage of the specified port to a value randomly chosen between lowCycle (inclusive) and highCycle (exclusive). lowCycle and highCycle are values between 0 and 100.