A Liquid Crystal Display(LCD) library for 8 * 1, 8 * 2 and 16 * 2 lcd for AVR microcontrollers by Microchip. This library drives the LCD in 4-bit mode. A list of supported display is given below. Check out the examples directory, contains example code on the various features, to get you started with this library.
This library supports:
- Printing single characters:
lcdWriteChar()
. - Printing strings:
lcdPrintStr()
orlcdPrintf()
. - Printing numbers:
lcdPrintInt()
for intgers,lcdPrintfloat()
for floating point numbers orlcdPrintf()
.
lcdPrintf()
is analogous to printf()
in C but with some limitations. It can be used in place of lcdPrintStr()
, lcdPrintInt()
and
lcdPrintfloat()
. Do keep in mind that it uses higher memory.
- Configure the display i.e. turn the display ON or OFF:
lcdSetting()
. - Shift the entire display left or right without changing the screen contents:
lcdShiftDisplay()
. - Clear the contents on the screen and reposition the cursor to the home position i.e. column 0 and row 0:
lcdClearDisplay()
.
- Configure the cursor i.e. enable the cursor and cursor blinking ON\OFF:
lcdSetting()
. - Set cursor positon:
lcdSetCursor()
.
Details on how to use the functions listed above along with code examples can be found in the examples directory.
It supports 8 * 1, 8 * 2 and 16 * 2 lcd.
It does not support 20 * 4 character lcds yet.
-
Include the liquidCrystalDisplay.h and liquidCrystalDisplay.c in your project directory. Alternatively, you can add the liquidCrystalDisplay.h and liquidCrystalDisplay.c as link in your project directory(this what I did).
-
Click on the hammer icon and change
Confrigrations: All Confrigrations
.
- Under
Toolchains->AVR/GNU C Compiler->Symbols
, add the system frequencyF_CPU=16000000L
(in my case it's 16MHz).
- Now, add
#include "LiquidCrytalDisplay.h"
in your project file.
This library has been tested with a 16 * 2 lcd on the ATmega 8A and ATmega328p.