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:
47:2eb1a863ebed
Parent:
46:6de3ebf5b195
Child:
49:93355c01e261
--- a/N5110.cpp	Mon Nov 27 15:21:36 2017 +0000
+++ b/N5110.cpp	Wed Dec 20 13:51:38 2017 +0000
@@ -128,13 +128,13 @@
 void N5110::setContrast(float contrast) {
     
     // enforce limits
-    if (contrast > 1.0)
-        contrast = 1.0;
-    else if (contrast < 0.0)
+    if (contrast > 1.0f)
+        contrast = 1.0f;
+    else if (contrast < 0.0f)
         contrast = 0.0;
     
     // convert to char in range 0 to 127 (i.e. 6 bits)
-    char ic = char(contrast*127.0);
+    char ic = char(contrast*127.0f);
     
     sendCommand(0b00100001);  // extended instruction set
     sendCommand(0b10000000 | ic);   // set Vop (which controls contrast)