PWM.setDutyCycle

Name
PWM.setDutyCycle - set PWM duty cycle

Description

 * void PWM.setDutyCycle (u8 pin, u16 duty)


 * Set duty cycle with 10-bits resolution (0-1023) allowing 1024 PWM steps. Can use any CCP module.

This chart shows 8bit(0-255) DutyCycle but 10bit(0-1023) uses the same concept.

Syntax

 * PWM.setDutyCycle(pin, duty);
 * PWM.setDutyCycle(u8 pin, u16 duty);

To use PWM, the device must be connected to a PWM pin. Pinguino x5(k)50   : 11, 12          (CCP1, CCP2) Pinguino 47J53     : 4, 5, 6, 7, 17  (CCP4, CCP5, CCP6, CCP7, CCP8) PIC32 Olimex Micro : 10, 11, 12, 13  (OC2, OC3, OC4, OC5) Other chips are unknown
 * pin


 * duty
 * 10 bit duty cycle (0 - 1023)


 * Returns/Output
 * None