Simple library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website).
Fork of N5110 by
Revision 20:0f2b35cfe9c9, committed 2016-04-26
- Comitter:
- robinmc
- Date:
- Tue Apr 26 18:43:22 2016 +0000
- Parent:
- 19:ba8addc061ea
- Commit message:
- Before organizing code
Changed in this revision
N5110.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r ba8addc061ea -r 0f2b35cfe9c9 N5110.cpp --- a/N5110.cpp Thu Apr 23 18:57:52 2015 +0000 +++ b/N5110.cpp Tue Apr 26 18:43:22 2016 +0000 @@ -90,9 +90,9 @@ void N5110::setBrightness(float brightness) { // check whether brightness is within range - if (brightness < 0.0) + if (brightness < 0.0f) brightness = 0.0; - if (brightness > 1.0) + if (brightness > 1.0f) brightness = 1.0; // set PWM duty cycle led->write(brightness); @@ -291,7 +291,7 @@ // 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)); + setPixel(i,47 - int(array[i]*47)); } refresh();