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

main.cpp

Committer:
smultron1977
Date:
2015-07-02
Revision:
4:46e538ce39d4
Parent:
2:e448efb1fa68

File content as of revision 4:46e538ce39d4:

// Project: Nokia5110 - Controlling a NK5110 display from an NXP LPC1768
// File: main.cpp
// Author: Chris Yan
// Created: January, 2012
// Revised: 
//  Desc: A basic LCD output test which uses the NXP LPC1768's SPI interface to 
//      display pixels, characters, and numbers on the Nokia 5110 LCD.
//      Created using a sparkfun breakout board with integrated Phillips 8544 driver
//      for 48x84 LCDs.
// 
// Version for EzSBC2 (an LPC1347 dev board similar to DipCortex M3) by Jonne Valola

#include "mbed.h"
#include "NOKIA_5110.h"

int main()
{
    // Init the data structures and NokiaLcd class
    LcdPins myPins;
    /*myPins.sce  = p8;
    myPins.rst  = p9;
    myPins.dc   = p10;
    myPins.mosi = p11;
    myPins.miso = NC;
    myPins.sclk = p13;*/
    myPins.sce  = P0_2; // SPI0 SSEL
    myPins.rst  = P0_4; // can be anything
    myPins.dc   = P0_5;
    myPins.mosi = P0_9;
    myPins.miso = P0_8;
    myPins.sclk = P1_29;
    
    NokiaLcd myLcd( myPins );
    
    // Start the LCD
    myLcd.InitLcd();

    // Draw a test pattern on the LCD and stall for 15 seconds
    myLcd.TestLcd( 0xAA );
    wait( 15 );
    
    // Turn off the LCD and enter an endless loop
    myLcd.ShutdownLcd();
    while( 1 )
    {   
        //dance
    }
}