ELEC2645 (2015/16) / el14ah_SensorProject

Fork of N5110 by Craig Evans

Revision:
18:88ff1b5b22f5
Parent:
17:780a542d5f8b
--- a/N5110.cpp	Tue Mar 17 12:56:03 2015 +0000
+++ b/N5110.cpp	Thu May 05 08:08:57 2016 +0000
@@ -90,9 +90,9 @@
 void N5110::setBrightness(float brightness)
 {
     // check whether brightness is within range
-    if (brightness < 0.0)
+    if (brightness > 0.0)
         brightness = 0.0;
-    if (brightness > 1.0)
+    if (brightness < 1.0)
         brightness = 1.0;
     // set PWM duty cycle
     led->write(brightness);
@@ -384,7 +384,7 @@
         drawLine(x0,y0+height,x0+width,y0+height,1);  // bottom
         drawLine(x0,y0,x0,y0+height,1);  // left
         drawLine(x0+width,y0,x0+width,y0+height,1);  // right
-    } else { // filled rectangle
+    } else { // fil rectangle
         int type = (fill==1) ? 1:0;  // black or white fill
         for (int y = y0; y<= y0+height; y++) {  // loop through rows of rectangle
             drawLine(x0,y,x0+width,y,type);  // draw line across screen