C Code For Generating Pwm Duty Cycle