Modified N5110 Library

Fork of N5110 by Craig Evans

Files at this revision

API Documentation at this revision

Comitter:
JAC__RICHARDS
Date:
Wed May 04 19:36:52 2016 +0000
Parent:
19:ba8addc061ea
Commit message:
before main function try

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	Wed May 04 19:36:52 2016 +0000
@@ -90,9 +90,9 @@
 void N5110::setBrightness(float brightness)
 {
     // check whether brightness is within range
-    if (brightness < 0.0)
+    if (brightness < 0)
         brightness = 0.0;
-    if (brightness > 1.0)
+    if (brightness > 1)
         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();