Simple library for interfacing to Nokia 5110 LCD display (as found on the SparkFun website).
Fork of N5110 by
Revision 20:9a5b47943f95, committed 2016-05-05
- Comitter:
- Martyrtle
- Date:
- Thu May 05 14:24:59 2016 +0000
- Parent:
- 19:ba8addc061ea
- Commit message:
- nothing changed
Changed in this revision
N5110.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/N5110.cpp Thu Apr 23 18:57:52 2015 +0000 +++ b/N5110.cpp Thu May 05 14:24:59 2016 +0000 @@ -65,7 +65,7 @@ void N5110::turnOn() { // set brightness of LED - 0.0 to 1.0 - default is 50% - setBrightness(0.5); + setBrightness(1.0); pwr->write(1); // apply power } @@ -90,10 +90,10 @@ void N5110::setBrightness(float brightness) { // check whether brightness is within range - if (brightness < 0.0) - brightness = 0.0; - if (brightness > 1.0) - brightness = 1.0; + if (brightness < 0.0f) + brightness = 0.0f; + if (brightness > 1.0f) + brightness = 1.0f; // 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();