diff --git a/predict_gesture/LED.cpp b/predict_gesture/LED.cpp index 31c852d..fa156b2 100644 --- a/predict_gesture/LED.cpp +++ b/predict_gesture/LED.cpp @@ -2,12 +2,14 @@ #include -LED::LED(int pin) +LED::LED() { - this->Pin = pin; - pinMode(this->Pin, OUTPUT); - + pinMode(LED_PIN, OUTPUT); + pinMode(BLUE_PIN, OUTPUT); + pinMode(RED_PIN, OUTPUT); + this->Off(); + this->Blank(); } void LED::On() @@ -27,4 +29,22 @@ void LED::Toggle() this->State ? this->Off() : this->On(); } -LED Led(LED_PIN); +void LED::Blue() +{ + digitalWrite(RED_PIN, HIGH); + digitalWrite(BLUE_PIN, LOW); +} + +void LED::Red() +{ + digitalWrite(BLUE_PIN, HIGH); + digitalWrite(RED_PIN, LOW); +} + +void LED::Blank() +{ + digitalWrite(BLUE_PIN, HIGH); + digitalWrite(RED_PIN, HIGH); +} + +LED Led; diff --git a/predict_gesture/LED.h b/predict_gesture/LED.h index 7eaba03..69e3a9d 100644 --- a/predict_gesture/LED.h +++ b/predict_gesture/LED.h @@ -2,16 +2,21 @@ #define _LED_H_ const int LED_PIN = 10; +const int BLUE_PIN = 6; +const int RED_PIN = 7; class LED { public: - LED(int pin); + LED(); + void On(); void Off(); void Toggle(); + void Blue(); + void Red(); + void Blank(); private: - int Pin; bool State; };