You are on page 1of 1

int count=0,next=0;

void interrupt() {
count++;
if(count==120&next==1){
ration 20s
GPIO.B0=0;
next=0;
}

//change count variable to change the output du

if(count==150)
//change count variable to change the duration
{
if(TMR1L<7&&TMR1L>3)
GPIO.B0=1;
next=1;
TMR1L=0;
count=0;
}
INTCON=0b10100000;
TMR0=0;
}

void main() {
OPTION_REG=0b00000111;
INTCON=0b10100000;
T1CON=0b00000111;
TMR1L=0;
TMR0=0;
GPIO.B0=0 ;
TRISIO.B0=0;
while(1){
}
}

30s

You might also like