![]() |
AlphaLCD helper for Arduino
1.0.4
LCD helper example for Arduino with AlphaLCD and Streaming library
|
#include <AlphaLCD.h>
#include <Streaming.h>
#include "LCD.h"
#include "Strings.h"
#include "Version.h"
Go to the source code of this file.
Functions | |
AlphaLCD | lcd (2, 3, 4) |
AlphaLCD class instance for display hardware control. More... | |
void | setup () |
void | loop (void) |
void | welcome () |
Welcome message shown at device power-on. More... | |
void | message (String m) |
Display a string on the LCD at the cursor position. More... | |
void | dec (int n) |
Display an integer value in decimal format at the cursor position. More... | |
void | hex (int n) |
Display an integer value in hex format at the cursor position. More... | |
void | error (String m, int x, int y) |
Display an error message at the specified cursor coordinates. More... | |
void | error (String m) |
Display an error message at the cursor position. More... | |
void | message (String m, int x, int y) |
Display a string on the LCD at the specified cursor coordinates. More... | |
void | clean () |
Clean the display. More... | |
void | menu (String sect1, String sect2, String sect3, String sect4) |
Creates a menu screen. More... | |
void clean | ( | ) |
Clean the display.
A delay of 100 ms is added after the hardware clear() call to give the display the time to complete the operation.
Definition at line 135 of file Display_Example.ino.
References lcd(), and LCDCLEAR_DELAY.
Referenced by menu().
void dec | ( | int | n | ) |
Display an integer value in decimal format at the cursor position.
n | the integer to show in decimal format |
Definition at line 71 of file Display_Example.ino.
References lcd().
void error | ( | String | m, |
int | x, | ||
int | y | ||
) |
Display an error message at the specified cursor coordinates.
The error message is shown for a LCDERROR_DELAY milliseconds. After the timeout expires the screen is not cleared so the next steps should be managed by the program flow. It is expected that error messages are shown in a calling code that manages the error conditions.
m | the message string |
x | the cursor column zero based |
y | the row number zero based |
Definition at line 97 of file Display_Example.ino.
References LCDERROR_DELAY, and message().
void error | ( | String | m | ) |
Display an error message at the cursor position.
The error message is shown for a LCDERROR_DELAY milliseconds. After the timeout expires the screen is not cleared so the next steps should be managed by the program flow. It is expected that error messages are shown in a calling code that manages the error conditions.
m | the string message |
Definition at line 112 of file Display_Example.ino.
References LCDERROR_DELAY, and message().
void hex | ( | int | n | ) |
Display an integer value in hex format at the cursor position.
n | the integer to show in hexadecimal format |
Definition at line 80 of file Display_Example.ino.
References lcd().
AlphaLCD lcd | ( | 2 | , |
3 | , | ||
4 | |||
) |
void loop | ( | void | ) |
Definition at line 29 of file Display_Example.ino.
void menu | ( | String | sect1, |
String | sect2, | ||
String | sect3, | ||
String | sect4 | ||
) |
Creates a menu screen.
The 2-lines LCD screen is divided in four sectors, that can be used or not. The LCD sectors length and position are defined and based on the LCD size. Every sector is filled with one of the four parameters string. Sectors 1 & 2 are in the top row, sectors 3 & 4 in the bottom row
sect1 | The Upper Left display sector |
sect2 | The Upper Right display sector |
sect3 | The Lower Left display sector |
sect4 | The Lower Right display sector |
Definition at line 153 of file Display_Example.ino.
References clean(), LCD_SECTOR1, LCD_SECTOR2, LCD_SECTOR3, LCD_SECTOR4, LCDBOTTOMROW, LCDTOPROW, and message().
void message | ( | String | m | ) |
Display a string on the LCD at the cursor position.
m | the message string |
Definition at line 62 of file Display_Example.ino.
References lcd().
void message | ( | String | m, |
int | x, | ||
int | y | ||
) |
Display a string on the LCD at the specified cursor coordinates.
m | the string message |
x | the cursor column zero based |
y | the row number zero based |
Definition at line 124 of file Display_Example.ino.
References lcd(), and message().
void setup | ( | ) |
void welcome | ( | ) |
Welcome message shown at device power-on.
Definition at line 42 of file Display_Example.ino.
References _SPACING, _VERSION, lcd(), LCDBOTTOMROW, LCDMESSAGE_DELAY, LCDTOPROW, and version.
Referenced by setup().