#include <htc.h>
# include "pic.h"
#include "lcd.h"
#define IR_Tx RA0
#define _XTAL_FREQ 4000000
__CONFIG(XT & WDTDIS & PWRTDIS & BORDIS & LVPDIS & UNPROTECT & MCLREN);
unsigned short i, DD0, DD1, DD2, DD3;
unsigned int RPM;
char lookup(int numb);
void wait();
void main() {
TRISB = 0b00000000; // Set PORTB direction to be output
TRISA = 0b00110000; // Set PORTA direction to be output
PORTB = 0x00; // Turn OFF LEDs on PORTB
CMCON = 7 ; // Disable comparators
RPM = 0; // Initial Value of Counter
OPTION= 0b00111000; // TOCS=1 for Counter mode, PSA=1 for 1:1
char ch1, ch2, ch3, ch4;
IR_Tx = 0; // Turn OFF IR
lcd_init();
lcd_clear();
lcd_goto(0);
lcd_puts(" Speed: ");
while(1){