14 pinMode(pin_, OUTPUT);
15 digitalWrite(pin_, initial_state);
19 digitalWrite(pin_, state);
20 return digitalRead(pin_) == state;
Simple, raw, Arduino GPIO-pin-controlled relay switch.
bool setState(BinaryLogicalState state) override
Updates the state of the switch. Returns true on success.
bool getState(BinaryLogicalState &result) const override
GpioRelay(uint8_t pin, BinaryLogicalState initial_state=BINARY_STATE_LOW)
BinaryLogicalState
Binary logical state used by selectors and switches.