I2CLCD
Driver for HD44780 LCD via I2C interface
 All Functions Groups Pages
main.c
1 #include <stdbool.h>
2 #include <stdint.h>
3 #include <avr/pgmspace.h>
4 #include "main.h"
5 #include <util/delay.h>
6 #include "i2clcd.h"
7 #include "i2cmaster.h"
8 
9 char string_flash[] PROGMEM = "Hello Flash!";
10 
11 int main(void)
12 {
13  char string1[] = "Hello World!";
14 
15  i2c_init();
16  lcd_init();
17 
18  lcd_light(true);
19  lcd_print(string1);
20  lcd_nextline();
21  lcd_print_P(PSTR("I2CLCD V0.11"));
22 
23  // always set all three parameters (OM/OFF) when using this command
25  _delay_ms(1000);
26 
28  _delay_ms(2);
29  lcd_print_P(string_flash);
30  lcd_printlc_P(2, 2, string_flash);
31 
32  //- Endless loop
33 
34  while (1) {
35 
36  }
37 }
void lcd_light(bool light)
Turn backlight ON/OFF.
Definition: i2clcd.c:336
#define LCD_CLEAR
Definition: i2clcd.h:197
bool lcd_printlc_P(uint8_t line, uint8_t col, char *string)
Print string from Flash to position (If string is longer than LCD_COLS overwrite first chars in line)...
Definition: i2clcd.c:211
#define LCD_CURSORON
Definition: i2clcd.h:215
#define LCD_BLINKINGON
Definition: i2clcd.h:217
void lcd_command(uint8_t command)
Issue a command to the display.
Definition: i2clcd.c:148
void lcd_print_P(PGM_P string)
Print string from Flash to cursor position.
Definition: i2clcd.c:165
void lcd_print(char *string)
Print string to cursor position.
Definition: i2clcd.c:156
bool lcd_nextline(void)
Go to nextline (if next line > LCD_LINES return false)
Definition: i2clcd.c:294
#define LCD_DISPLAYON
Definition: i2clcd.h:213
void lcd_init(void)
Display initialization sequence.
Definition: i2clcd.c:49