Analog Set Period

Configure the period of Pulse Width Modulation (PWM) on the specified analog pin. Before you call this function, you should set the specified pin as analog.

pins.analogSetPeriod(AnalogPin.P1, 20000)

Parameters

The following code first sets P0 to analog with analog write pin, and then sets the PWM period of P0 to 20,000 microseconds.

pins.analogWritePin(AnalogPin.P1, 512)
pins.analogSetPeriod(AnalogPin.P1, 20000)

See also

Calliope mini pins, on pin pressed, analog read pin, analog write pin, digital read pin, digital write pin

Edit this page on GitHub