/***************************************************** This program was produced by the CodeWizardAVR V1.24.8d Professional Automatic Program Generator © Copyright 1998-2006 Pavel Haiduc, HP InfoTech s.r.l. http://www.hpinfotech.com Project : Version : Date : 09.08.2007 Author : F4CG Company : F4CG Comments: Chip type : ATmega8535 Program type : Application Clock frequency : 8,000000 MHz Memory model : Small External SRAM size : 0 Data Stack size : 128 *****************************************************/ #include #include #include #define xtal 8000000L #define baud 9600 typedef unsigned char byte; /* table for the user defined character arrow that points to the top right corner */ flash byte char0[8]={ 0b0000000, 0b0001111, 0b0000011, 0b0000101, 0b0001001, 0b0010000, 0b0100000, 0b1000000}; /* function used to define user characters */ void define_char(byte flash *pc,byte char_code) { byte i,a; a=(char_code<<3) | 0x40; for (i=0; i<8; i++) lcd_write_byte(a++,*pc++); } void main(void) { char k; UBRR=xtal/16/baud-1; UCR=0x18; PORTA=0x00; DDRA=0x00; PORTB=0x00; DDRB=0xFF; PORTC=0x00; DDRC=0x00; PORTD=0x00; DDRD=0x00; lcd_init (16); define_char(char0,0); lcd_gotoxy (0,0); while (1) { k=getchar(); lcd_putchar(k); if (k == "Z") { putsf("j"); } }; }