mikroC

making it simple...

Pwm_Change_Duty

mikroC - C Compiler for Microchip PIC microcontrollers

Prototype

void Pwm_Change_Duty(char duty_ratio);

 

 

Description

Changes PWM duty ratio. Parameter duty_ratio takes values from 0 to 255, where 0

 

is 0%, 127 is 50%, and 255 is 100% duty ratio. Other specific values for duty ratio can

 

be calculated as (Percent*255)/100.

 

 

Requires

You need a CCP module on PORTC to use this library. To use this function, module

 

needs to be initalized – see Pwm_Init.

 

 

Example

Pwm_Change_Duty(192); // Set duty ratio to 75%

 

 

Pwm_Start

Prototype

void Pwm_Start(void);

 

 

Description

Starts PWM.

 

 

Requires

You need a CCP module on PORTC to use this library. To use this function, module

 

needs to be initalized – see Pwm_Init.

 

 

Example

Pwm_Start();

 

 

Pwm_Stop

Prototype

void Pwm_Stop(void);

 

 

Description

Stops PWM.

 

 

Requires

You need a CCP module on PORTC to use this library. To use this function, module

 

needs to be initalized – see Pwm_Init.

 

 

Example

Pwm_Stop();

 

 

 

 

page

 

MikroElektronika: Development tools - Books - Compilers

241