Easily display labels and values on an LCD screen with flexible formatting.
UltiBlox on GitHub | UltiBlox Home
The DisplayValueLCD library simplifies displaying text and values on LCD screens, making it ideal for embedded projects that need flexible text displays. It provides options for centering text, adding suffixes (e.g., units), and clearing rows for updated display content.
- Display custom labels and values with optional suffixes.
- Center text automatically for a clear, balanced display.
- Clear lines as needed to refresh display content.
- Easily interchangeable with the
DisplayValueOLEDlibrary for OLED displays.
The DisplayValueLCD library is compatible with DisplayValueOLED for OLED screens. Both libraries share the same function signatures, allowing you to switch between LCD and OLED displays by simply changing the library declaration in your code.
- Open the Arduino IDE.
- Go to Tools > Manage Libraries.
- Search for UltiBlox-DisplayValueLCD and click Install.
- Access example sketches under File > Examples > UltiBlox-DisplayValueLCD.
-
Clone the Repository:
git clone git@github.com:UltiBlox/DisplayValueLCD.git ~/workspace/DisplayValueLCD cd ~/workspace/DisplayValueLCD
-
Prepare the Environment: Run the
prepare.shscript to set up dependencies:bash prepare.sh
-
Install the Library:
-
Copy Installation:
bash install.sh
-
Symlink Installation (for active development):
bash install-symlink.sh
-
-
Build Examples: Compile example sketches with:
bash build.sh
- LCDI2C: Required for LCD display communication.
- Arduino Core Library
- HelloWorld.ino: Demonstrates setting up the display with a label and a sample value, continuously updating the displayed value from
A0.
init()Initializes the LCD display and turns on the backlight.
clear()Clears the entire display content.
setLabel(const char* value)Sets and centers a label text at the top of the display.
setValue(int value)Displays the specified integer value on the display, centered for visibility.
setSuffix(const char* value)Sets a suffix, such as a unit symbol, to be displayed next to the value.