rc522-read

cesars/rc522/rc522-read

No description
rc522-read
@/rc522-read
522@/rc522-dev
UPDpulse
rc522-read
D1
D2
D3
D4
D5
DONE
522
UPD
DONEpulse
D5byte
D4byte
D3byte
D2byte
D1byte
To use the node in your project you should have the cesars/rc522 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 {

        uint8_t status;
        uint8_t data[MAX_LEN];
        uint8_t serial[6];

    void evaluate(Context ctx) {
        if (!isInputDirty<input_UPD>(ctx))return;

        auto rfid = getValue<input_522>(ctx);

        status = rfid->requestTag(MF1_REQIDL, data);
        if (status == MI_OK) {
            status = rfid->antiCollision(data);
            memcpy(serial, data, 6);
            emitValue<output_D1>(ctx, serial[0]);
            emitValue<output_D2>(ctx, serial[1]);
            emitValue<output_D3>(ctx, serial[2]);
            emitValue<output_D4>(ctx, serial[3]);
            emitValue<output_D5>(ctx, serial[4]);
            emitValue<output_DONE>(ctx, 1);
        }
    }
}