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:
36:00ebd449b6f3
Parent:
35:2d5931a66fba
Child:
42:596c207519de
--- a/N5110.cpp	Tue Mar 07 16:46:13 2017 +0000
+++ b/N5110.cpp	Tue Mar 07 16:55:43 2017 +0000
@@ -433,20 +433,16 @@
     }
 }
 
-void N5110::drawGlyph(int x0,
+void N5110::drawSprite(int x0,
                       int y0,
-                      int nx,
-                      int ny,
-                      int *glyph)
-{
-    printf("Draw Glyph:\n");
-    
-    for (int i = 0; i < nx; i++) {
-        for (int j = 0 ; j < ny ; j++) {
+                      int nrows,
+                      int ncols,
+                      int *sprite)
+{ 
+    for (int i = 0; i < nrows; i++) {
+        for (int j = 0 ; j < ncols ; j++) {
 
-            int pixel = *((glyph+i*ny)+j);
-
-            printf("%d,%d = %d\n",i,j,pixel);
+            int pixel = *((sprite+i*ncols)+j);
 
             if (pixel) {
                 setPixel(x0+j,y0+i);
@@ -457,5 +453,4 @@
 
         }
     }
-
 }
\ No newline at end of file