This patch reads the value of the PORTD registry and outputs the bool value of pins 0-6 (this is limited due to an error. a patch cannot have more than 7 outputs)
portd-read
@/portd-read
This patch reads the value of the PORTD registry and outputs the bool value of pins 0-6 (this is limited due to an error. a patch cannot have more than 7 outputs)
UPDpulse
Signals when the code should run.
PIN6boolean
Outputs the pin 6 reg value in bool
PIN5boolean
Outputs the pin 5 reg value in bool
PIN4boolean
Outputs the pin 4 reg value in bool
PIN3boolean
Outputs the pin 3 reg value in bool
PIN2boolean
Outputs the pin 2 reg value in bool
PIN1boolean
Outputs the pin 1 reg value in bool
PIN0boolean
Outputs the pin 0 reg value in bool
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) {
//auto inValue = getValue<input_IN>(ctx);
//emitValue<output_OUT>(ctx, inValue);
if (!isInputDirty<input_UPD>(ctx))//This line controls how often this codes run.
return;
emitValue<output_PIN0>(ctx, PORTD & B00000001);
emitValue<output_PIN1>(ctx, PORTD & B00000010);
emitValue<output_PIN2>(ctx, PORTD & B00000100);
emitValue<output_PIN3>(ctx, PORTD & B00001000);
emitValue<output_PIN4>(ctx, PORTD & B00010000);
emitValue<output_PIN5>(ctx, PORTD & B00100000);
emitValue<output_PIN6>(ctx, PORTD & B01000000);
//emitValue<output_PIN7>(ctx, PORTD & B10000000);
}