write(digital-portb)

koadrobot/ports/write(digital-portb)

No description
write(digital-portb)
@/write(digital-portb)
P0boolean
P1boolean
P2boolean
P3boolean
P4boolean
P5boolean
P6boolean
P7boolean
SIGboolean
State
PULLboolean
Hardware connection. pulldown (true) - High, pullup (false) - Low (1-duty).
UPDpulse
Triggers new write
write(digital-portb)
DONE
P0
P1
P2
P3
P4
P5
P6
P7
SIG
PULL
UPD
DONEpulse
Fires on writing complete
To use the node in your project you should have the koadrobot/ports 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

struct State {
};

{{ GENERATED_CODE }}

void evaluate(Context ctx)
{
    if (isInputDirty<input_UPD>(ctx))
    {
        bool val = getValue<input_SIG>(ctx);

        if (!getValue<input_PULL>(ctx)) val = !val;

        if (getValue<input_P0>(ctx)) { ::pinMode(0, OUTPUT);  ::digitalWrite(0, val); }
        if (getValue<input_P1>(ctx)) { ::pinMode(1, OUTPUT);  ::digitalWrite(1, val); }
        if (getValue<input_P2>(ctx)) { ::pinMode(2, OUTPUT);  ::digitalWrite(2, val); }
        if (getValue<input_P3>(ctx)) { ::pinMode(3, OUTPUT);  ::digitalWrite(3, val); }
        if (getValue<input_P4>(ctx)) { ::pinMode(4, OUTPUT);  ::digitalWrite(4, val); }
        if (getValue<input_P5>(ctx)) { ::pinMode(5, OUTPUT);  ::digitalWrite(5, val); }
        if (getValue<input_P6>(ctx)) { ::pinMode(6, OUTPUT);  ::digitalWrite(6, val); }
        if (getValue<input_P7>(ctx)) { ::pinMode(7, OUTPUT);  ::digitalWrite(7, val); }

        emitValue<output_DONE>(ctx, 1);
    }
}