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);
}
}
}