Mikroc, Pwm_change_duty, Pwm_start – ABL electronic PIC Microcontrollers PIC16 User Manual

Page 249: Pwm_stop

Advertising
background image

MikroElektronika: Development tools - Books - Compilers

241

page

mikroC - C Compiler for Microchip PIC microcontrollers

mikroC

making it simple...

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_Change_Duty

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_Start

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();

Pwm_Stop

Advertising
This manual is related to the following products: