/*********************************************************** * Program: AVRGCC - LCD test * Created: 10.10.99 17:23 * Author: Bray++ * Comments: printf is in very Alfa stage...:) ************************************************************/ #include #include "lcd.h" void putstr16(char *p) { byte i; lcd_home(); for (i=16; i-- && *p;) { lcd_putch(*p++); } } const static char msg[] = "\ Welcome to the test of the LCD display."; int main(void) { unsigned char byte, *p; unsigned char j; outp(0xff, DDRC); outp(1, PORTC); // Light one of the LEDs outp(0, DDRB); // Set up the input outp(0xff, PORTB); // Pull ups lcd_init(); p = (char *) msg; for (;;) { outp(~inp(PORTC), PORTC); // Toggle the two leds putstr16(p); for (j = 200; j--;) lcd_udelay(1 ms); if (!*p++) p = (char *) msg; } }