Add generic IsOff
This commit is contained in:
parent
5ecbbaf463
commit
8359351f78
@ -3,3 +3,9 @@
|
|||||||
Switch::Switch() { this->type = Thing::SwitchType; }
|
Switch::Switch() { this->type = Thing::SwitchType; }
|
||||||
|
|
||||||
bool Switch::IsOn() { return false; }
|
bool Switch::IsOn() { return false; }
|
||||||
|
|
||||||
|
bool Switch::IsOff() {
|
||||||
|
bool isOn = IsOn();
|
||||||
|
bool isOff = !isOn;
|
||||||
|
return isOff;
|
||||||
|
}
|
2
Switch.h
2
Switch.h
@ -14,6 +14,8 @@ public:
|
|||||||
/// @brief Test of the switch is on
|
/// @brief Test of the switch is on
|
||||||
/// @return true when the switch returns a HIGH value
|
/// @return true when the switch returns a HIGH value
|
||||||
virtual bool IsOn();
|
virtual bool IsOn();
|
||||||
|
|
||||||
|
virtual bool IsOff();
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace RoboidControl
|
} // namespace RoboidControl
|
||||||
|
Loading…
x
Reference in New Issue
Block a user