23 lines
524 B
C
23 lines
524 B
C
|
#ifndef OUTPUTENDPOINT_H
|
||
|
#define OUTPUTENDPOINT_H value
|
||
|
|
||
|
#include <Endpoint.h>
|
||
|
|
||
|
class OutputEndpoint : public Endpoint {
|
||
|
private:
|
||
|
int pin;
|
||
|
bool inverted;
|
||
|
bool currentValue;
|
||
|
|
||
|
public:
|
||
|
OutputEndpoint(int _pin, bool _inverted = false) : Endpoint("output"),
|
||
|
pin(_pin), inverted(_inverted), currentValue(inverted) {
|
||
|
pinMode(pin, OUTPUT);
|
||
|
digitalWrite(pin, currentValue);
|
||
|
}
|
||
|
|
||
|
EndpointResult onValue(String property, String value);
|
||
|
};
|
||
|
|
||
|
#endif /* ifndef OUTPUTENDPOINT_H */
|