Hi there, I need some help with my program.i am using the mifare rc522 classic board with three tags. I wish to use them to detect / undetect items. I am able to turn on LED with first time tag but cannot off LED for second time tag. This is to show when the item is in, LED on.When the item is out, LED off. My codings are as follows:
//First item
if(str[0] == 181) //First card ID = 181
{
count = count ++;
Serial.print("Item Found: Book\n"); // Serial out
digitalWrite(6, HIGH); // Buzzer on
delay(200);
digitalWrite(6, LOW); //Buzzer off
digitalWrite(7, HIGH); //LED on
}
if(str[0] == 181 && count == 2 ) // First card ID = 181
{
Serial.print("Item out: Book\n"); // Serial Out
digitalWrite(6, HIGH); // Buzzer on
delay(200);
digitalWrite(6, LOW); //Buzzer off
digitalWrite(7, LOW); //LED off
count =0;
}
I do hope I can get some help here, I think I need to use some sort of maths or boolean feature to initiate count. Any help is much appreciated..thank you!