portb-write

krishowell/mass-digital-write/portb-write

Writes the signal value to pins selected from the pin input. of PORTB registry. ex - 0011 0001 input write the SIG value to pins 10, 11, and 15.
portb-write
@/portb-write
Writes the signal value to pins selected from the pin input. of PORTB registry. ex - 0011 0001 input write the SIG value to pins 10, 11, and 15.
PINbyte
A binary number that represents each pin of the target hardware on PORTB. Setting a bit to "1" selects the pin for writing. The most significant bit is first and the least significant is last. ex- ardunio uno most significant bit is pin 8 and the least significant is pin 15
UPDpulse
SIGboolean
the value that is written to the selected pins.
portb-write
PIN
UPD
SIG
DONE
DONEpulse
Outputs a pulse when the code has finish writing to the PORTB registry
To use the node in your project you should have the krishowell/mass-digital-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
    const bool SIG = getValue<input_SIG>(ctx);

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