Simple library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website). Edited to include additional feaatures, such as 2d array loading, multiple screen buffers, and better backlight control
Dependencies: N5110
Fork of N5110 by
Diff: N5110.cpp
- Revision:
- 8:40abe5736eca
- Parent:
- 7:3010f24e0a81
- Child:
- 9:7701f0126ba7
--- a/N5110.cpp Mon May 19 18:23:21 2014 +0000 +++ b/N5110.cpp Mon May 19 18:45:48 2014 +0000 @@ -261,4 +261,21 @@ buffer[i][j]=0; } } +} + +// function to plot array on display +void N5110::plotArray(float array[]) { + + int i; + + for (i=0; i<84; i++) { // loop through array + // elements are normalised from 0.0 to 1.0, so multiply + // by 47 to convert to pixel range, and subtract from 47 + // since top-left is 0,0 in the display geometry + setPixel(i,47 - (int) array[i]*47.0); + } + + refresh(); + + } \ No newline at end of file