Writes the signal value to its respective pins. The PIN input selects the PORTB registry. that will be written.
ex - 0011 0001b input write the SIG value to pins 8, 12, and 13.
portb-mass-write-bool
@/portb-mass-write-bool
Writes the signal value to its respective pins. The PIN input selects the PORTB registry. that will be written.
ex - 0011 0001b input write the SIG value to pins 8, 12, and 13.
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.
SIG8boolean
The value that will be written to pin 8
SIG9boolean
The value that will be written to pin 9
SIG10boolean
The value that will be written to pin 10
SIG11boolean
The value that will be written to pin 11
SIG12boolean
The value that will be written to pin 12
SIG13boolean
The value that will be written to pin 13
SIG14boolean
The value that will be written to pin 14
SIG15boolean
The value that will be written to pin 15
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 = 8; i < 16; i++, PIN = PIN >> 1){
if(PIN & B00000001){
::pinMode(i, OUTPUT);
switch(i){
case 8:
::digitalWrite(i, getValue<input_SIG0>(ctx));
break;
case 9:
::digitalWrite(i, getValue<input_SIG1>(ctx));
break;
case 10:
::digitalWrite(i, getValue<input_SIG2>(ctx));
break;
case 11:
::digitalWrite(i, getValue<input_SIG3>(ctx));
break;
case 12:
::digitalWrite(i, getValue<input_SIG4>(ctx));
break;
case 13:
::digitalWrite(i, getValue<input_SIG5>(ctx));
break;
case 14:
::digitalWrite(i, getValue<input_SIG6>(ctx));
break;
case 15:
::digitalWrite(i, getValue<input_SIG7>(ctx));
break;
}
}
}
emitValue<output_DONE>(ctx, 1);
}