#include <16F877A.h>
#fuses XT,NOWDT,NOPROTECT,BROWNOUT,PUT,NOLVP
#use delay(clock=4000000)
void main()
{
int duty;
setup_ccp1(CCP_PWM);
setup_timer_2(T2_DIV_BY_16, 255, 1);
while(1)
{
set_pwm1_duty(duty);
if(duty<255)
duty++;
else
duty=0;
delay_ms(10);
}
}
yukarıdaki...