Resit project for target localisation

Revision:
47:2eb1a863ebed
Parent:
46:6de3ebf5b195
Child:
49:93355c01e261
diff -r 6de3ebf5b195 -r 2eb1a863ebed N5110.cpp
--- a/N5110.cpp	Mon Nov 27 15:21:36 2017 +0000
+++ b/N5110.cpp	Wed Dec 20 13:51:38 2017 +0000
@@ -128,13 +128,13 @@
 void N5110::setContrast(float contrast) {
     
     // enforce limits
-    if (contrast > 1.0)
-        contrast = 1.0;
-    else if (contrast < 0.0)
+    if (contrast > 1.0f)
+        contrast = 1.0f;
+    else if (contrast < 0.0f)
         contrast = 0.0;
     
     // convert to char in range 0 to 127 (i.e. 6 bits)
-    char ic = char(contrast*127.0);
+    char ic = char(contrast*127.0f);
     
     sendCommand(0b00100001);  // extended instruction set
     sendCommand(0b10000000 | ic);   // set Vop (which controls contrast)