e-digital-read

hio/nwt-gus-hi/e-digital-read

Reads digital signal value from board GPIO port. Possible errors: — Invalid port
e-digital-read
@/e-digital-read
Reads digital signal value from board GPIO port. Possible errors: — Invalid port
PORTport
Board-Port, von dem gelesen werden soll.
UPDpulse
Löst ein neues Lesen aus.
e-digital-read
PORT
UPD
SIG
DONE
DONEpulse
Löst aus, wenn das Lesen abgeschlossen ist.
SIGboolean
Der zuletzt gelesene Signalwert.

Previously known as xod/core/digital-input.

To use the node in your project you should have the hio/nwt-gus-hi 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

#pragma XOD evaluate_on_pin disable
#pragma XOD evaluate_on_pin enable input_UPD

node {
    void evaluate(Context ctx) {
        static_assert(isValidDigitalPort(constant_input_PORT), "must be a valid digital port");

        if (!isInputDirty<input_UPD>(ctx))
            return;

        ::pinMode(constant_input_PORT, INPUT);
        emitValue<output_SIG>(ctx, ::digitalRead(constant_input_PORT));
        emitValue<output_DONE>(ctx, 1);
    }
}