Here the variable pot value will vary from 0-40 based on the potentiometer value. So when the value is 0 we have to make a PWM with 0 duty cycle and when 40% we have to make a pwm with 100% duty cycle.
When the value of on_time is 170 a 100% duty cycle will be formed by the timer0 module and when 130 i.e (170-40) a 0% duty cycle will be formerd. To understand the concept better you can download the simulation file and try simulating the code by using different values for 170
Aswinth Raj
PermalinkHere the variable pot value will vary from 0-40 based on the potentiometer value. So when the value is 0 we have to make a PWM with 0 duty cycle and when 40% we have to make a pwm with 100% duty cycle.
When the value of on_time is 170 a 100% duty cycle will be formed by the timer0 module and when 130 i.e (170-40) a 0% duty cycle will be formerd. To understand the concept better you can download the simulation file and try simulating the code by using different values for 170
- Log in or register to post comments
Joined August 16, 2016 1000Tuesday at 12:29 AM