Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
// simple 38 kHz PWM generation for PIC16F877A
// check PWM library selection in IDE
// PWM output is on RC2
// ensure oscillator settings are correct in mikroE configuration settings
void main() {
PWM1_Init(38000); // turn on PWM at 38kHz
PWM1_Set_Duty(128); // 50% duty cycle
// simple test program - 500 Hz modulation on 38kHz carrier
while(1){ // loop forever
PWM1_Start(); // 38kHz turned on
Delay_ms(1);
PWM1_stop(); // 38kHz turned off
Delay_ms(1);
}
}
tolerance , i couldn't understand it , could you please explain it?