Hardware Reference
In-Depth Information
{
mfrc522.PICC_HaltA();
mfrc522.PCD_StopCrypto1();
buzzer_error=1;
previousMillis_buzzer=currentMillis;
digitalWrite(alarm_r,HIGH);
return;
}
Otherwise, read the first block (block A) from card memory.
status = mfrc522.MIFARE_Read(valueBlockA, buffer, &size);
If the fifth byte is zero, it means that the card was not on card reader device before and we
should write on it entrance time and date. After writing hour, minute, day, month and year
on it, set the fifth byte to indicate that the entrance time is written on card memory. Then
log out from card and sound a beep, to indicate that the process is completed successfully.
Then it decreases the parking capacity by one unit.
if(buffer[5]==0)
{
value1Block[0]=mytm.Minute;
value1Block[1]=mytm.Hour;
value1Block[2]=mytm.Day;
value1Block[3]=mytm.Month;
value1Block[4]=mytm.Year-96;
value1Block[5]=1;
status = mfrc522.MIFARE_Write(valueBlockA, value1B-
lock, 16);
mfrc522.PICC_HaltA();
mfrc522.PCD_StopCrypto1();
buzzer_ok=1;
previousMillis_buzzer=currentMillis;
Search WWH ::




Custom Search