#include
#include"delay.h"
__CONFIG(HS&WDTDIS&PWRTEN&UNPROTECT);
char f=0;
int count=0,x=586;
void main()
{
INTF=0;
INTEDG=0;
INTE=1;
GIE=0;
TRISA=0x0f;
TRISB=3;
PORTB=0;
if(RA2==0)
{
DelayMs(250);
DelayMs(250);
DelayMs(250);
DelayMs(250);
GIE=1;
f=1;
}
while(f==1)
{
if(countx)
{
RB2=0;
RB3=1;
RB4=0;
RB5=1;
}
}
}
interrupt isr()
{
if(RB1==0)
{
count++;
INTF=0;
}
if(RB1==1)
{
count--;
INTF=0;
}
}
|