
/*
**	Compiler Include Directives
*/
#include <avr/io.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>
#include <avr/signal.h>
#include "lcd_4bit.h"
#include "delay.h"
//#include <stdio.h>			//	Uncomment line if using printf



/*
**	External Global Variables
*/
extern volatile uint16_t delayCount;



/*
**	Interrupt Vectors
*/

/*
**	Output Compare Interrupt Vector
**
*/
SIGNAL(SIG_OUTPUT_COMPARE0)
{
	//	Increment the delay counter variable
	delayCount++;
}



/*
**	Function to output a character to the LCD if using printf.  Uncomment
**	if needed
*/
/*
int def_putc(char ch)
{
	writeByteToLCD(ch);
}
*/



/*
**	Main Function
*/
int main(void)
{
	//	Initialize timer 0 to interrupt every 50 microseconds
	initializeDelayTimerMicrosecond();

	//	Enable interrupts
	sei();
	
	//	Initialize the LCD
	initializeLCD();
	
	//	Define standard out (if using printf)
	//fdevopen(def_putc, NULL, 0);

	//	Output some strings to the LCD
	writeStringToLCD("Hello World!");
	writeIntegerToLCD(1234);
	writeIntegerToLCD(5678);
	writeIntegerToLCD(90);
	
	//	Finally, return 0
	return 0;
}


