portb-read

krishowell/port-read-write/portb-read

This patch reads the value of the PORTB registry and outputs the bool value to the respective bool output Pin 8-13
portb-read
@/portb-read
This patch reads the value of the PORTB registry and outputs the bool value to the respective bool output Pin 8-13
UPDpulse
Signals when the code should run.
portb-read
PIN8
PIN9
PIN10
PIN11
PIN12
PIN13
UPD
PIN13boolean
Outputs pin 13 reg value in bool
PIN12boolean
Outputs pin 12 reg value in bool
PIN11boolean
Outputs pin 11 reg value in bool
PIN10boolean
Outputs pin 10 reg value in bool
PIN9boolean
Outputs pin 9 reg value in bool
PIN8boolean
Outputs pin 8 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_PIN8>(ctx, PORTD & B00000001);
    emitValue<output_PIN9>(ctx, PORTD & B00000010);
    emitValue<output_PIN10>(ctx, PORTD & B00000100);
    emitValue<output_PIN11>(ctx, PORTD & B00001000);
    emitValue<output_PIN12>(ctx, PORTD & B00010000);
    emitValue<output_PIN13>(ctx, PORTD & B00100000);
}