Simple library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website).
Fork of N5110 by
Diff: N5110.cpp
- Revision:
- 22:5e20f9c16da0
- Parent:
- 20:07627b054c2d
--- a/N5110.cpp Fri May 01 09:15:10 2015 +0000 +++ b/N5110.cpp Mon May 04 16:02:29 2015 +0000 @@ -6,7 +6,7 @@ */ #include "mbed.h" #include "N5110.h" - +#include <string> N5110::N5110(PinName pwrPin, PinName scePin, PinName rstPin, PinName dcPin, PinName mosiPin, PinName sclkPin, PinName ledPin) { @@ -235,6 +235,8 @@ } } + + // function to print string at specified position void N5110::printString(const char * str,int x,int y) { @@ -263,6 +265,13 @@ } } +void N5110::printNum(int n,int x, int y) +{ + char buffer[3]; + sprintf(buffer,"%i",n); + printString(buffer,x,y); +} + // function to clear the screen void N5110::clear() {