Library for multi-pin RGB leds that encapsulates three PwmOut objects.

Dependents:   MAX32630FTHR_RGB

Revision:
3:327cc9243faf
Parent:
2:ecd3840bb6a7
--- a/MultipinRGB.h	Tue Mar 28 22:33:51 2017 +0000
+++ b/MultipinRGB.h	Tue Mar 28 23:24:17 2017 +0000
@@ -95,10 +95,11 @@
     ///Destructor
     ~MultipinRGB();
     
-    ///@brief Sets duty cycle for red led.\n
+    ///@brief Sets duty cycle for led.\n
     ///
     ///On Entry:
-    ///@param[in] r - Duty cycle for led, 0.0 to 1.0 
+    ///@param[in] led - Led to update
+    ///@param[in] dc - Duty cycle for led, 0.0 to 1.0 
     ///
     ///On Exit:
     ///@param[out] none
@@ -119,10 +120,10 @@
     ///@returns none
     void writeLeds(const float r, const float g, const float b);
     
-    ///@brief Reads duty cycle for red led.\n
+    ///@brief Reads duty cycle for led.\n
     ///
     ///On Entry:
-    ///@param[in] none 
+    ///@param[in] led - Led to update
     ///
     ///On Exit:
     ///@param[out] none
@@ -145,6 +146,18 @@
     ///@returns none
     void  readLeds(float& r, float& g, float& b);
     
+    ///@brief Toggles led from off to on, or on to off.\n
+    ///Duty Cycle will be 0% or 100% after this call.\n
+    ///
+    ///On Entry:
+    ///@param[in] led - Led to toggle 
+    ///
+    ///On Exit:
+    ///@param[out] none
+    ///
+    ///@returns none
+    void toggleLed(const Led_e led);
+    
     ///@brief Sets pwm period for all three leds.\n
     ///
     ///On Entry:
@@ -162,8 +175,6 @@
     PwmOut m_green;
     PwmOut m_blue;
     
-    float m_redDc, m_grnDc, m_bluDc;
-    
     LedLogic_e m_ledActiveState;
 };