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:
32:c9643726edca
Parent:
31:8a0c21042f82
Child:
33:d80e568a2e18
--- a/N5110.cpp	Thu Feb 16 15:36:44 2017 +0000
+++ b/N5110.cpp	Thu Feb 16 15:41:00 2017 +0000
@@ -11,15 +11,14 @@
              PinName const mosiPin,
              PinName const sclkPin,
              PinName const ledPin)
-{
-    // set up pins as required
-    _spi = new SPI(mosiPin,NC,sclkPin); // create new SPI instance and initialise
-    _led = new PwmOut(ledPin);
-    _pwr = new DigitalOut(pwrPin);
-    _sce = new DigitalOut(scePin);
-    _rst = new DigitalOut(rstPin);
-    _dc = new DigitalOut(dcPin);
-}
+    :
+    _spi(new SPI(mosiPin,NC,sclkPin)), // create new SPI instance and initialise
+    _led(new PwmOut(ledPin)),
+    _pwr(new DigitalOut(pwrPin)),
+    _sce(new DigitalOut(scePin)),
+    _rst(new DigitalOut(rstPin)),
+    _dc(new DigitalOut(dcPin))
+{}
 
 // overloaded constructor does not include power pin - LCD Vcc must be tied to +3V3
 // Best to use this with K64F as the GPIO hasn't sufficient output current to reliably
@@ -30,15 +29,14 @@
              PinName const mosiPin,
              PinName const sclkPin,
              PinName const ledPin)
-{
-    // set up pins as required
-    _spi = new SPI(mosiPin,NC,sclkPin); // create new SPI instance and initialise
-    _pwr = NULL;  // pwr not needed so null it to be safe
-    _led = new PwmOut(ledPin);
-    _sce = new DigitalOut(scePin);
-    _rst = new DigitalOut(rstPin);
-    _dc = new DigitalOut(dcPin);
-}
+    :
+    _spi(new SPI(mosiPin,NC,sclkPin)), // create new SPI instance and initialise
+    _led(new PwmOut(ledPin)),
+    _pwr(NULL), // pwr not needed so null it to be safe
+    _sce(new DigitalOut(scePin)),
+    _rst(new DigitalOut(rstPin)),
+    _dc(new DigitalOut(dcPin))
+{}
 
 N5110::~N5110()
 {