Namaste everyone,
i am Hitendra from INDIA,
i am just verify the id from rfid tag with the help of following project (code), according to the code when i scan the tag/card then it gives the output as i want but the amin problem is,
"When I scan the tag/card second time,then it not scanning. if I scan the card just after second scan then it gives output"
hence the sensor scan the tag/card one time and one time gets paralised so please suggest me some hint,errors,solution in the code so i can solve this query.
.
.
.
Thanking You ( '◡' )
code..,
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
int id[12] = { 0, 'F', 0, 0, 3, 3, 'A', 4, 7, 'E', 'E', 6 };
char reader;
int flag = 0;
void setup() {
Serial.begin(9600);
mySerial.begin(9600);
mySerial.println("Hello, world?");
}
void loop() {
if (mySerial.available()) {
reader = mySerial.read();
for (int i = 0; i < 12; i++) {
if (id[i] == reader) {
flag++;
if (flag == 12) {
Serial.print("ha flag 12 hai\n");
flag = 0;
}
}
}
}
}
In the my code I get output as I required
But only a problem happens
Is that it recieved the data "one after other"
.
.
.
Can you simplify the errors in the code please!