portd-mass-write-bool

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

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-bool
@/portd-mass-write-bool
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 PORTB. Setting a bit to "1" selects the pin for writing.
SIG0boolean
The value that will be written to pin 0
SIG1boolean
The value that will be written to pin 1
SIG2boolean
The value that will be written to pin 2
SIG3boolean
The value that will be written to pin 3
SIG4boolean
The value that will be written to pin 4
SIG5boolean
The value that will be written to pin 5
SIG6boolean
The value that will be written to pin 6
SIG7boolean
The value that will be written to pin 7
portd-mass-write-bool
UPD
PIN
SIG0
SIG1
SIG2
SIG3
SIG4
SIG5
SIG6
SIG7
DONE
DONEpulse
Signals when the write operation has finished.
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
    
    for(byte i = 0; i < 8; i++, PIN = PIN >> 1){
        if(PIN & B00000001){
            ::pinMode(i, OUTPUT);
            switch(i){
                case 0:
                    ::digitalWrite(i, getValue<input_SIG0>(ctx));
                    break;
                case 1:
                    ::digitalWrite(i, getValue<input_SIG1>(ctx));
                    break;
                case 2:
                    ::digitalWrite(i, getValue<input_SIG2>(ctx));
                    break;
                case 3:
                    ::digitalWrite(i, getValue<input_SIG3>(ctx));
                    break;
                case 4:
                    ::digitalWrite(i, getValue<input_SIG4>(ctx));
                    break;
                case 5:
                    ::digitalWrite(i, getValue<input_SIG5>(ctx));
                    break;
                case 6:
                    ::digitalWrite(i, getValue<input_SIG6>(ctx));
                    break;
                case 7:
                    ::digitalWrite(i, getValue<input_SIG7>(ctx));
                    break;
            }
        }
    }
    emitValue<output_DONE>(ctx, 1);
}