I'm trying to modificate an Arduino sketch, can you explain me these lines of code?
What is the delay for?
<while(softSerial.available()) softSerial.read();
nano.getVersion();
if (nano.msg[0] == ERROR_WRONG_OPCODE_RESPONSE)
{
//This happens if the baud rate is correct but the module is doing a ccontinuous read
nano.stopReading();
Serial.println(F("Module continuously reading. Asking it to stop..."));
delay(540000);
}
else
{
//The module did not respond so assume it's just been powered on and communicating at 115200bps
softSerial.begin(115200); //Start software serial at 115200
nano.setBaud(baudRate); //Tell the module to go to the chosen baud rate. Ignore the response msg
softSerial.begin(baudRate); //Start the software serial port, this time at user's chosen baud rate
When RFID tag is detected the sequence start but if the tag is detected again the sequence start again from zero.
How can I insert a pause after the first detection?
Create a variable that stores the millis value of the last time a tag was found, then calculate the difference between the real time millis and that variable to see how long it has been since the last time a tag was found.