read-pir

britt/sparkfun-qwiicpir/read-pir

No description
read-pir
@/read-pir
DEV@/qwiicpir-device
UPDpulse
read-pir
DEV
UPD
DET
REM
DEB
DONE
DONEpulse
DEBnumber
REMboolean
DETboolean
To use the node in your project you should have the britt/sparkfun-qwiicpir 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

node {

    void evaluate(Context ctx) {

        if (!isInputDirty<input_UPD>(ctx))
           return;
        auto pir = getValue<input_DEV>(ctx);

        bool det = pir -> objectDetected();
        bool rem = pir -> objectDetected();
        uint16_t deb = pir -> getDebounceTime();


        emitValue<output_DET>(ctx, det);
        emitValue<output_REM>(ctx, rem);
        emitValue<output_DEB>(ctx, deb);
        emitValue<output_DONE>(ctx, 1);



    }
}