forked from noisymime/rallyduino
-
Notifications
You must be signed in to change notification settings - Fork 0
/
LCD_i2c.h
42 lines (36 loc) · 1.43 KB
/
LCD_i2c.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
Library to handle 'intelligent' i2c LCD controller boards.
uses the library available at http://www.wentztech.com/radio/arduino/files/LCDI2C.html
The following functions are mandatory:
LCD_PRINT_ARROW_UP() - Print an up arrow
LCD_PRINT_ARROW_DOWN() - Print a down arrow
LCD_PRINT_ARROW_LEFT() - Print a left arror
LCD_PRINT_ARROW_RIGHT() - Print a right arrow
LCD_clear() - Clear the LCD screen
LCD_set_custom_characters() - Define the arrow/custom characters. Can be blank if not required
LCD_print_string_with_coords(char *string, int x, int y) - Print a string at a given location
LCD_big_number_mode - If available turn on 4 digit 'big number' mode. If this is not available the library should just blank the screen, turn on a flashing cursor and home to (0,0)
LCD_print_int - Print an int
*/
#ifdef lcd_i2c_h
#include "WConstants.h"
//Macros
#define LCD_PRINT_ARROW_UP() Serial.print("?1"); delay(50);
#define LCD_PRINT_ARROW_DOWN() Serial.print("?2"); delay(50);
#define LCD_PRINT_ARROW_LEFT() Serial.print("?5"); delay(50);
#define LCD_PRINT_ARROW_RIGHT() Serial.print("?6"); delay(50);
#define LCD_ARROW_UP "1"
#define LCD_ARROW_DOWN "2"
#define LCD_ARROW_LEFT "5"
#define LCD_ARROW_RIGHT "6"
class LCD
{
public:
LCD();
void LCD_clear();
void LCD_set_custom_characters();
void LCD_print_string_with_coords(char *string, int x, int y);
void LCD_big_number_mode(boolean is_big);
void LCD_print_int(int to_print);
};
#endif