A fork of Chris Yan's Nokia 5110 LCD library, adapted to LPC1347. Should work on a DipCortex M3 and an EzSBC2 dev board.

Dependencies:   mbed

Fork of Nokia5110 by Krissi Yan

Committer:
Fuzball
Date:
Mon Jan 16 19:51:19 2012 +0000
Revision:
1:e25ab356dc9b
Child:
2:e448efb1fa68
Forgot to change the project\'s title :3;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Fuzball 1:e25ab356dc9b 1 // Project: Nokia5110 - Controlling a NK5110 display from an NXP LPC1768
Fuzball 1:e25ab356dc9b 2 // File: main.cpp
Fuzball 1:e25ab356dc9b 3 // Author: Chris Yan
Fuzball 1:e25ab356dc9b 4 // Created: January, 2012
Fuzball 1:e25ab356dc9b 5 // Revised:
Fuzball 1:e25ab356dc9b 6 // Desc: A basic LCD output test which uses the NXP LPC1768's SPI interface to
Fuzball 1:e25ab356dc9b 7 // display pixels, characters, and numbers on the Nokia 5110 LCD.
Fuzball 1:e25ab356dc9b 8 // Created using a sparkfun breakout board with integrated Phillips 8544 driver
Fuzball 1:e25ab356dc9b 9 // for 48x84 LCDs.
Fuzball 1:e25ab356dc9b 10
Fuzball 1:e25ab356dc9b 11 #include "mbed.h"
Fuzball 1:e25ab356dc9b 12 #include "NOKIA_5110.h"
Fuzball 1:e25ab356dc9b 13
Fuzball 1:e25ab356dc9b 14 int main()
Fuzball 1:e25ab356dc9b 15 {
Fuzball 1:e25ab356dc9b 16 // Init the data structures and NokiaLcd class
Fuzball 1:e25ab356dc9b 17 LcdPins myPins;
Fuzball 1:e25ab356dc9b 18 myPins.sce = p8;
Fuzball 1:e25ab356dc9b 19 myPins.rst = p9;
Fuzball 1:e25ab356dc9b 20 myPins.dc = p10;
Fuzball 1:e25ab356dc9b 21 myPins.mosi = p11;
Fuzball 1:e25ab356dc9b 22 myPins.miso = NC;
Fuzball 1:e25ab356dc9b 23 myPins.sclk = p13;
Fuzball 1:e25ab356dc9b 24
Fuzball 1:e25ab356dc9b 25 NokiaLcd myLcd( myPins );
Fuzball 1:e25ab356dc9b 26
Fuzball 1:e25ab356dc9b 27 // Start the LCD
Fuzball 1:e25ab356dc9b 28 myLcd.InitLcd();
Fuzball 1:e25ab356dc9b 29
Fuzball 1:e25ab356dc9b 30 // Draw a test pattern on the LCD and stall for 15 seconds
Fuzball 1:e25ab356dc9b 31 myLcd.TestLcd( 0xAA );
Fuzball 1:e25ab356dc9b 32 wait( 15 );
Fuzball 1:e25ab356dc9b 33
Fuzball 1:e25ab356dc9b 34 // Turn off the LCD and enter an endless loop
Fuzball 1:e25ab356dc9b 35 myLcd.ShutdownLcd();
Fuzball 1:e25ab356dc9b 36 while( 1 )
Fuzball 1:e25ab356dc9b 37 {
Fuzball 1:e25ab356dc9b 38 //dance
Fuzball 1:e25ab356dc9b 39 }
Fuzball 1:e25ab356dc9b 40 }