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.
unsigned int TimerOverFlow;
float countLeft,TimerTimeLeft,TotalTimeTaken,RPM,x;
static void interrupt isr()
{
if(INTF)
{
if(TMR1ON==0)
{
TimerOverFlow=0;
TMR1H=0xFB;
TMR1L=0x1D;
TMR1ON=1;
}
else
{
TMR1ON=0;
INTE=0;
countLeft=(TMR1H*256+TMR1L)-0xFB1D;
TimerTimeLeft=countLeft/125000;
TotalTimeTaken=TimerOverFlow*0.01+TimerTimeLeft;
x=countLeft;
RPM=60/TotalTimeTaken;
TimerOverFlow=0;
TMR1H=TMR1L=0;
INTE=1;
TMR1ON=1;
}
INTF=0;
}
if(TMR1IF)
{
TMR1H=0xFB;
TMR1L=0x1D;
TimerOverFlow++;
TMR1IF=0;
}
}
//////////////////////////////////
void main(void){
unsigned RPMReadingHold;
TRISA = TRISC = 0x00;
PORTA = PORTC = 0x00;
INTCON=0xC0;
INTE=1;
T1CON=0X30;
TMR1H=0xFB;
TMR1L=0x1E;
INTEDG=1;