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-byte
@/portb-mass-write-byte
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.
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 PORTB.
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 = 8; i < 16; i++, PIN = PIN >> 1){
if(PIN & B00000001){
::pinMode(i, OUTPUT);
::digitalWrite(i, (SIG >> (i-8)) & B00000001);
}
}
emitValue<output_DONE>(ctx, 1);
}