A basic LCD output test which uses the NXP LPC1768\'s SPI interface to display pixels, characters, and numbers on the Nokia 5110 or Nokia 3310 LCD.
Quick and versatile LCD screen control. Works as a great alternative to serial consoles!
---------
Inverted-color text function makes easy menus and borders
Uses a simple SetXY(char, char) function to draw data-plots or patterns
- Wiring -
LCD's connections from left to right:
1) +3.3v (V_lcd) - mbed's VOUT
2) GND - mbed's GND
3) SCE (chip select) - mbed's p8
4) RST (reset) - mbed's p9
5) DC (data/command) - mbed's p10
6) MOSI - mbed's p11
7) SCLK (serial clock) - mbed's p13
8) +3.3v (V_backlight) - mbed's VOUT
The code for this setup would be...
LcdPins myPins;
myPins.sce = p8;
myPins.rst = p9;
myPins.dc = p10;
myPins.mosi = p11;
myPins.miso = NC;
myPins.sclk = p13;
or more easily...
LcdPins myPins = { p11, NC, p13, p10, p8, p9 };
Init the NokiaLcd class using the above struct...
NokiaLcd myLcd( myPins );
then start the LCD using...
myLcd.InitLcd();
Simple text output is achieved with either of these functions:
void DrawString(char* str);
void DrawChar(char character);
------
Better documentation, pre/post conditions, and extended draw functions are coming soon :)
History
commiting :D
2021-10-15, by Fuzball [Fri, 15 Oct 2021 20:36:21 +0000] rev 4
commiting :D
Cleaned up the code a little, added more draw commands, and threw in some functions for drawing strings
2014-01-10, by Fuzball [Fri, 10 Jan 2014 22:22:17 +0000] rev 3
Cleaned up the code a little, added more draw commands, and threw in some functions for drawing strings
Cleaned up some non-code stuff and updated to use the newer mbed libs
2014-01-10, by Fuzball [Fri, 10 Jan 2014 19:57:40 +0000] rev 2
Cleaned up some non-code stuff and updated to use the newer mbed libs
Forgot to change the project\'s title :3;
2012-01-16, by Fuzball [Mon, 16 Jan 2012 19:51:19 +0000] rev 1
Forgot to change the project\'s title :3;