: writePWMDutyCyle (ar, pin, value)

Set pin to output a square wave with a specified duty cycle.

Inputs

ar - connected arduino object

pin - pin to write to.

value - duty cycle value where 0 = off, 0.5 = 50% on, 1 = always on.

Example


a = arduino();
writePWMDutyCycle(a,'D5',0.5);

See also: arduino, writePWMVoltage.

Package: arduino