JIAWEI ZHANG / Mbed 2 deprecated ele350ku

Dependencies:   mbed

Dependents:   Exercise8_1-2-3

Fork of ele350 by JIAWEI ZHANG

Revision:
16:085b9b2a9343
Parent:
15:8c0d195355d2
Child:
17:e92adffd15c7
--- a/Led.cpp	Thu Nov 19 13:06:59 2015 +0000
+++ b/Led.cpp	Thu Nov 19 13:11:55 2015 +0000
@@ -1,27 +1,30 @@
-#include "led.h"        //includes the header with the class definition 
+#include "Led.h"        //includes the header with the class definition 
 #include <vector>
 //constructor
 Led::Led(string name)      //contructor implementation
 {
-    if(name == "red"){
-    this->pinName = PD_14;         //The pin for the red led
-} else if(name == "green"){
-    this->pinName = PD_12;
-} else if(name == "orange"){
-    this->pinName = PD_13;    
-} else if(name == "blue"){
-    this->pinName = PD_15;    
+    if(name == "red") {
+        this->pinName = PD_14;         //The pin for the red led
+    } else if(name == "green") {
+        this->pinName = PD_12;
+    } else if(name == "orange") {
+        this->pinName = PD_13;
+    } else if(name == "blue") {
+        this->pinName = PD_15;
+    }
+}
+void Led::On()
+{
+    this->pin->write(1);
+    this->isSwitchedOn = true;
 }
 
-void Led::On() {         
-     this->pin->write(1);
-     this->isSwitchedOn = true;
+void Led::Off()
+{
+    this->pin->write(0);
+    this->isSwitchedOn = false;
 }
-
-void Led::Off(){
-     this->pin->write(0);
-     this->isSwitchedOn = false;
+bool Led::getIsSwitchenOn()
+{
+    return this->isSwitchedOn;
 }
-    bool Led::getIsSwitchenOn(){
-        return this->isSwitchedOn;
-}