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:
42:596c207519de
Parent:
40:c9262294f2e1
Child:
44:57f9d32fb521
--- a/N5110.h	Wed Mar 08 16:13:08 2017 +0000
+++ b/N5110.h	Tue Mar 21 10:43:19 2017 +0000
@@ -86,7 +86,7 @@
         lcd.setBrightness(0.5); // put LED backlight on 50%
 
         lcd.clear();
-        // x origin, y origin, rows, cols, sprite 
+        // x origin, y origin, rows, cols, sprite
         lcd.drawSprite(20,6,8,5,(int *)sprite);
         lcd.refresh();
         wait(5.0);
@@ -126,7 +126,7 @@
             }
         }
 
-     
+
 
         // can check status of pixel using getPixel(x,y);
         lcd.clear();  // clear buffer
@@ -316,23 +316,33 @@
                    unsigned int const x,
                    unsigned int const y);
 
-    /** Set a Pixel
+    /**
+    * @brief Set a Pixel
     *
-    *   This function sets a pixel in the screen buffer.
-    *   @param  x - the x co-ordinate of the pixel (0 to 83)
-    *   @param  y - the y co-ordinate of the pixel (0 to 47)
+    * @param x     The x co-ordinate of the pixel (0 to 83)
+    * @param y     The y co-ordinate of the pixel (0 to 47)
+    * @param state The state of the pixel [true=black (default), false=white]
+    *
+    * @details This function sets the state of a pixel in the screen buffer.
+    *          The third parameter can be omitted,
     */
     void setPixel(unsigned int const x,
-                  unsigned int const y);
+                  unsigned int const y,
+                  bool const         state = true);
 
-    /** Clear a Pixel
+    /**
+    *  @brief Clear a Pixel
     *
-    *   This function clears pixel in the screen buffer
     *   @param  x - the x co-ordinate of the pixel (0 to 83)
     *   @param  y - the y co-ordinate of the pixel (0 to 47)
+    *
+    *   @details This function clears pixel in the screen buffer
+    *
+    *   @deprecated Use setPixel(x, y, false) instead
     */
     void clearPixel(unsigned int const x,
-                    unsigned int const y);
+                    unsigned int const y)
+    __attribute__((deprecated("Use setPixel(x,y,false) instead")));
 
     /** Get a Pixel
     *
@@ -426,8 +436,10 @@
                     int y0,
                     int nrows,
                     int ncols,
-                    int *sprite);
-                    
+                    int *sprite)
+    __attribute__((deprecated("Use the Bitmap::render() function instead")));
+
+
 private:
 // methods
     void setXYAddress(unsigned int const x,