Library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website).

Dependents:   LV7_LCDtest LV7_Grupa5_Tim003_Zadatak1 lv7_Grupa5_Tim008_zad1 LV7_PAI_Grupa5_tim10_Zadatak1 ... more

This library is designed to make it easy to interface an mbed with a Nokia 5110 LCD display.

These can be found at Sparkfun (https://www.sparkfun.com/products/10168) and Adafruit (http://www.adafruit.com/product/338).

The library uses the SPI peripheral on the mbed which means it is much faster sending data to the display than other libraries available on other platforms that use software SPI.

The library can print strings as well as controlling individual pixels, meaning that both text and primitive graphics can be displayed.

Revision:
22:31c54fc61f12
Parent:
21:4cbdc20fea9f
Child:
23:eb7e6632fc9e
--- a/N5110.cpp	Sat Jan 28 20:25:43 2017 +0000
+++ b/N5110.cpp	Wed Feb 01 12:48:13 2017 +0000
@@ -13,7 +13,6 @@
 N5110::N5110(PinName pwrPin, PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin)
 {
     spi = new SPI(mosiPin,NC,sclkPin); // create new SPI instance and initialise
-    initSPI();
 
     // set up pins as required
     led = new PwmOut(ledPin);
@@ -30,7 +29,6 @@
 N5110::N5110(PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin)
 {
     spi = new SPI(mosiPin,NC,sclkPin); // create new SPI instance and initialise
-    initSPI();
 
     // set up pins as required
     led = new PwmOut(ledPin);
@@ -43,6 +41,8 @@
 // initialise function - powers up and sends the initialisation commands
 void N5110::init()
 {
+    initSPI();
+
     turnOn();     // power up
     wait_ms(10);  // small delay seems to prevent spurious pixels during mbed reset
     reset();      // reset LCD - must be done within 100 ms