LCD5110 Basic
LCD5110 Basic
Manual
http://www.RinkyDinkElectronics.com/
Introduction:
This library has been made to make it easy to use the basic functions of the Nokia 5110 LCD
module on an Arduino or a chipKit.
Basic functionality of this library are based on the demo-code provided by ITead studio.
You can always find the latest version of the library at http://www.RinkyDinkElectronics.com/
For version information, please refer to version.txt.
This library is licensed under a CC BY-NC-SA 3.0 (Creative Commons AttributionNonCommercial-ShareAlike 3.0 Unported) License.
For more information see: http://creativecommons.org/licenses/by-nc-sa/3.0/
Library Manual: LCD5110_Basic
Page 2
Defined Literals:
Alignment
0
9999
9998
Included Fonts:
SmallFont
Charactersize:
Number of characters:
6x8 pixels
95
MediumNumbers
Charactersize:
Number of characters:
12x16 pixels
13
BigNumbers
Charactersize:
Number of characters:
14x24 pixels
13
Page 3
Functions:
LCD5110(SCK, MOSI, DC, RST, CS);
Usage:
SCK:
MOSI:
DC:
RST:
CS:
LCD5110
Usage:
Notes:
contrast:
<optional>
Specify a value to use for contrast (0-127)
Default is 70
myGLCD.initLCD(); // Initialize the display
This will reset and clear the display.
setContrast(contrast);
None
myGLCD.enableSleep(); // Put the display into Sleep Mode
Entering Sleep Mode will not turn off the backlight as this is a hardware function.
disableSleep();
None
myGLCD.disableSleep(); // Wake the display after putting it into Sleep Mode
The display will automatically be cleared when Sleep Mode is disabled.
Exiting Sleep Mode will not turn on the backlight as this is a hardware function.
clrScr();
None
myGLCD.clrScr(); // Clear the screen
clrRow(row[, start_x[, end_x]]);
Usage:
row:
8 pixel high
start_x: <optional>
x-coordinate
end_x:
<optional>
x-coordinate
myGLCD.clrRow(5, 42);
Page 4
print(st, x, y);
Usage:
Notes:
Usage:
Notes:
Usage:
Notes:
fontname: Name of the array containing the font you wish to use
myGLCD.setFont(SmallFont); // Select the font called SmallFont
You must declare the font-array as an external or include it in your sketch.
invertText(mode);
Select if text printed with print(), printNumI() and printNumF() should be inverted.
Parameters:
Usage:
Notes:
Usage:
Notes:
x:
x-coordinate of the upper, left corner of the bitmap
y:
y-coordinate of the upper, left corner of the bitmap
data: array containing the bitmap-data
sx:
width of the bitmap in pixels
sy:
height of the bitmap in pixels
myGLCD.drawBitmap(0, 0, bitmap, 32, 32); // Draw a 32x32 pixel bitmap in the upper left corner
You can use the online-tool ImageConverter Mono to convert pictures into compatible arrays.
The online-tool can be found on my website.
Requires that you #include <avr/pgmspace.h> when using an Arduino other than Arduino Due.
Page 5