RFID Read Pause

0

I'm developing an RFID reader using Arduino + RFID module RDM6300, I am able to perform the readings of the cards, however, the readings are being repeated several times when the card is approached. I have already tried using delay(); and only increased the time between the various readings. I would like that every time you approach the card, it would only be read once and prevented from reading for 3 seconds for example.

Follow my code below.

#include <SoftwareSerial.h>
#include "RDM6300.h"

SoftwareSerial rdm_serial(9, 10);
RDM6300<SoftwareSerial> rdm(&rdm_serial);


void setup()
{
  Serial.begin(115200);
  Serial.println("SETUP");
}

void loop()
{

  static const unsigned long long my_id = 0x0000ABCDEF;
  static unsigned long long last_id = 0;

  last_id = rdm.read();

                union {
                  unsigned long long ull;
                  unsigned long ul[2];
                } 
                tmp;
                tmp.ull = last_id;
                Serial.print(tmp.ul[1], HEX);
                unsigned long beacon = 0x10000000;
                while(beacon > 0) {
                  if(tmp.ul[0] < beacon)
                    Serial.print("0");
                  else
                    break;
                  beacon >>= 4;
                }
                Serial.print(tmp.ul[0], HEX);

  Serial.println();


}

    
asked by anonymous 28.03.2018 / 20:25

0 answers