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:
33:d80e568a2e18
Parent:
32:c9643726edca
Child:
35:2d5931a66fba
--- a/N5110.cpp	Thu Feb 16 15:41:00 2017 +0000
+++ b/N5110.cpp	Thu Feb 16 15:58:48 2017 +0000
@@ -322,7 +322,7 @@
 void N5110:: drawCircle(unsigned int const x0,
                         unsigned int const y0,
                         unsigned int const radius,
-                        unsigned int const fill)
+                        FillType const     fill)
 {
     // from http://en.wikipedia.org/wiki/Midpoint_circle_algorithm
     int x = radius;
@@ -332,7 +332,7 @@
     while(x >= y) {
 
         // if transparent, just draw outline
-        if (fill == 0) {
+        if (fill == FILL_TRANSPARENT) {
             setPixel( x + x0,  y + y0);
             setPixel(-x + x0,  y + y0);
             setPixel( y + x0,  x + y0);
@@ -343,7 +343,7 @@
             setPixel(-x + x0, -y + y0);
         } else {  // drawing filled circle, so draw lines between points at same y value
 
-            int type = (fill==1) ? 1:0;  // black or white fill
+            int type = (fill==FILL_BLACK) ? 1:0;  // black or white fill
 
             drawLine(x+x0,y+y0,-x+x0,y+y0,type);
             drawLine(y+x0,x+y0,-y+x0,x+y0,type);
@@ -418,15 +418,15 @@
                      unsigned int const y0,
                      unsigned int const width,
                      unsigned int const height,
-                     unsigned int const fill)
+                     FillType const     fill)
 {
-    if (fill == 0) { // transparent, just outline
+    if (fill == FILL_TRANSPARENT) { // transparent, just outline
         drawLine(x0,y0,x0+(width-1),y0,1);  // top
         drawLine(x0,y0+(height-1),x0+(width-1),y0+(height-1),1);  // bottom
         drawLine(x0,y0,x0,y0+(height-1),1);  // left
         drawLine(x0+(width-1),y0,x0+(width-1),y0+(height-1),1);  // right
     } else { // filled rectangle
-        int type = (fill==1) ? 1:0;  // black or white fill
+        int type = (fill==FILL_BLACK) ? 1:0;  // black or white fill
         for (int y = y0; y<y0+height; y++) {  // loop through rows of rectangle
             drawLine(x0,y,x0+(width-1),y,type);  // draw line across screen
         }