water-atomizer

rcb71/water-atomizer/water-atomizer

No description
water-atomizer
@/water-atomizer
PORTport
ENboolean
water-atomizer
PORT
EN
DONE
DONEpulse
To use the node in your project you should have the rcb71/water-atomizer library installed. Use the “File → Add Library” menu item in XOD IDE if you don’t have it yet. See Using libraries for more info.

C++ implementation

node {
    void evaluate(Context ctx) {
        static_assert(isValidAnalogPort(constant_input_PORT), "must be a valid analog port");
        
        auto enable = getValue<input_EN>(ctx);
        pinMode(constant_input_PORT, OUTPUT);

        if (enable) {
            digitalWrite(constant_input_PORT, HIGH);
        }
        else {
            digitalWrite(constant_input_PORT, LOW);
        }
        
        emitValue<output_DONE>(ctx, 1);
    }
}