Add generic IsOff

This commit is contained in:
Pascal Serrarens 2024-01-09 10:22:13 +01:00
parent 5ecbbaf463
commit 8359351f78
2 changed files with 8 additions and 0 deletions

View File

@ -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;
}

View File

@ -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