#include <18F25K22.h>
#device ADC=8

#FUSES NOWDT                 	//No Watch Dog Timer
#FUSES PRIMARY               	//Primary clock is system clock when scs=00
#FUSES FCMEN                 	//Fail-safe clock monitor enabled
#FUSES IESO                  	//Internal External Switch Over mode enabled
#FUSES PUT                   	//Power Up Timer
#FUSES BROWNOUT              	//Reset when brownout detected
#FUSES BORV19                	//Brownout reset at 1.9V
#FUSES CCP3B5                	//CCP3 input/output multiplexed with RB5
#FUSES HFOFST                	//High Frequency INTRC starts clocking CPU immediately
#FUSES TIMER3C0              	//Timer3 Clock In is on pin C0
#FUSES CCP2B5                	//CCP2 input/output multiplexed with RB5
#FUSES NOPROTECT             	//Code not protected from reading
#FUSES NOWRT                 	//Program memory not write protected
#FUSES NOEBTR                	//Memory not protected from table reads
#FUSES NOMCLR

#use delay(internal=16MHz)

// LCD pin definitions
#define LCD_ENABLE_PIN PIN_C0
#define LCD_RS_PIN PIN_C2
#define LCD_RW_PIN PIN_C1
#define LCD_DATA4 PIN_C4
#define LCD_DATA5 PIN_C5
#define LCD_DATA6 PIN_C6
#define LCD_DATA7 PIN_C7

// Pin definitions
#define BTN_1 PIN_A4
#define BTN_2 PIN_A5
#define MOTOR_A PIN_A6
#define MOTOR_B PIN_A7

// Function definitions
int read_pot(int pot);
void sane_lcd_gotoxy(int x, int y);