portd-mass-write-byte

krishowell/port-read-write/portd-mass-write-byte

Writes the signal value to its respective pins. The PIN input selects the PORTD registry. that will be written. ex - 0011 0001b input write the SIG value to pins 0, 4, and 5.
portd-mass-write-byte
@/portd-mass-write-byte
Writes the signal value to its respective pins. The PIN input selects the PORTD registry. that will be written. ex - 0011 0001b input write the SIG value to pins 0, 4, and 5.
UPDpulse
Signals when the code should run.
PINbyte
A binary number that represents each pin of the target hardware on PORTD. Setting a bit to "1" selects the pin for writing.
SIGbyte
A binary number that represents each pin's state that will be writen (1 for HIGH, 0 for LOW)of the target hardware on PORTD.
portd-mass-write-byte
UPD
PIN
SIG
DONE
DONEpulse
pulses when the patch has finish writing.
To use the node in your project you should have the krishowell/port-read-write 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))//This line controls how often this codes run.
        return;

    byte PIN = getValue<input_PIN>(ctx);//The PIN varible retrieves the byte input node value
    byte SIG = getValue<input_SIG>(ctx);

    for(byte i = 0; i < 8; i++, PIN = PIN >> 1){
        if(PIN & B00000001){
            ::pinMode(i, OUTPUT);
            ::digitalWrite(i, (SIG >> i) & B00000001);
        }
    }
    emitValue<output_DONE>(ctx, 1);
}