#Define LED GPIO.B2 //pin 5
#Define LED GPIO.B2 //pin 5
B2 //pin 5
bit toggle;
PIR1.TMR1IF = 0;
if (toggle==0)
{
TMR1H = 255; // Cleat timer1 registers
PWM=0;
toggle=1;
else if (toggle==1)
PWM=1;
toggle=0;
void InitTimer1(void)
void chk_limit ()
if (on_time>250)
on_time=249;
if (on_time<5)
on_time=6;
if (off_time>250)
off_time=249;
}
if (off_time<5)
off_time=6;
if (on_time<10)
LED=1;
else if (on_time>10)
LED=0;
void main()
CMCON = 7;
ADC_Init();
InitTimer1();
off_time=125;
on_time=125;
toggle=0;
PWM=0;
LED=0;
do
CLAMP=0;
else
{CLAMP =1;}
while (1);