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:
27:0d8d90936b4c
Parent:
26:36be85c20ef4
Child:
28:4091516537e4
Child:
30:11986573659e
--- a/N5110.cpp	Tue Feb 07 11:24:32 2017 +0000
+++ b/N5110.cpp	Tue Feb 07 21:50:25 2017 +0000
@@ -381,14 +381,14 @@
 void N5110::drawRect(int x0,int y0,int width,int height,int fill)
 {
     if (fill == 0) { // transparent, just outline
-        drawLine(x0,y0,x0+width,y0,1);  // top
-        drawLine(x0,y0+height,x0+width,y0+height,1);  // bottom
-        drawLine(x0,y0,x0,y0+height,1);  // left
-        drawLine(x0+width,y0,x0+width,y0+height,1);  // right
+        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
-        for (int y = y0; y<= y0+height; y++) {  // loop through rows of rectangle
-            drawLine(x0,y,x0+width,y,type);  // draw line across screen
+        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
         }
     }
 }