Oscar Schofield / Mbed 2 deprecated Elec350_OBS

Dependencies:   mbed

Revision:
20:85a44ddbdc41
Parent:
19:6ad1702c5d90
diff -r 6ad1702c5d90 -r 85a44ddbdc41 led.cpp
--- a/led.cpp	Fri Nov 27 10:24:41 2015 +0000
+++ b/led.cpp	Fri Nov 27 12:37:31 2015 +0000
@@ -36,11 +36,13 @@
     return *LedOut;
 }
 
-void Led::Toggle(){
-    if(this -> Status()){
-        this->Off();
-        }else{
-            this->On();
-        }
-    wait(0.1f);
+bool Led::Toggle(){
+    if(this -> Status()){   // Checks if the current Pin out Status is on (true)
+        this->Off();        // turn LED off
+        return *LedOut;     //  return LED Status as Off
+    }
+    else{                   // If Led is off
+        this->On();         // Turn Led on
+        return *LedOut;     // return LED Status as On 
+    }
 }