diff --git a/Switch.cpp b/Switch.cpp index d49b0d3..8a6bd38 100644 --- a/Switch.cpp +++ b/Switch.cpp @@ -3,3 +3,9 @@ Switch::Switch() { this->type = Thing::SwitchType; } bool Switch::IsOn() { return false; } + +bool Switch::IsOff() { + bool isOn = IsOn(); + bool isOff = !isOn; + return isOff; +} \ No newline at end of file diff --git a/Switch.h b/Switch.h index f15e3ad..b787277 100644 --- a/Switch.h +++ b/Switch.h @@ -14,6 +14,8 @@ public: /// @brief Test of the switch is on /// @return true when the switch returns a HIGH value virtual bool IsOn(); + + virtual bool IsOff(); }; } // namespace RoboidControl