1 /*********************************************
2 * vim: set sw=8 ts=8 si :
3 * Author: Guido Socher, Copyright: GPL
4 * This is a test program which will write "LCD works"
6 * This program is also used to test the keypad. It
7 * displays the button last pressed.
9 * See http://www.tuxgraphics.org/electronics/
12 * Clock frequency : Internal clock 8 Mhz
13 *********************************************/
15 #include <avr/pgmspace.h>
17 #define F_CPU 8000000UL // 8 MHz
18 #include <util/delay.h>
25 void delay_ms(uint16_t ms)
26 /* delay for a minimum of <ms> */
28 // we use a calibrated macro. This is more
29 // accurate and not so much compiler dependent
44 lcd_puts("LCD works");
53 lcd_puts_p(PSTR("U+ pressed"));
58 lcd_puts_p(PSTR("U- pressed"));
65 lcd_puts_p(PSTR("I+ pressed"));
70 lcd_puts_p(PSTR("I- pressed"));
73 if (check_store_button()){
75 lcd_puts_p(PSTR("store"));
77 lcd_puts_p(PSTR("pressed"));
83 lcd_puts_p(PSTR("press"));
85 lcd_puts_p(PSTR("a button"));