Implemented first Hangar-Service

Dependencies:   CalibrateMagneto QuaternionMath

Fork of SML2 by TobyRich GmbH

Revision:
35:fb6e4601adf3
Parent:
33:bd56fc8aeb0a
Child:
46:fd5a62296b12
--- a/LEDDriver.cpp	Wed May 06 07:50:02 2015 +0000
+++ b/LEDDriver.cpp	Fri May 08 06:20:18 2015 +0000
@@ -21,7 +21,6 @@
 
 void LEDDriver::setColor(const uint8_t r, const uint8_t g, const uint8_t b)
 {
-    write_reg(0x0e, b);
     write_reg(0x04, g);
     write_reg(0x03, r);
     write_reg(0x02, b);
@@ -42,7 +41,11 @@
 
 void LEDDriver::setWhiteLed(const float w)
 {
-    const uint8_t value = (uint8_t) (w * 255);
+    uint8_t value = (uint8_t) (w * 255);
+    
+    if (value > 255)
+        value = 255;
+    
     write_reg(0x0e, value);
 }