Hardware Reference
In-Depth Information
digitalWrite(alarm_g,HIGH);
digitalWrite(buzzer,HIGH);
capacity--;
if(capacity < 0)
capacity=0;
EEPROM.write(0,capacity);
}
But if the fifth byte is one, it means that this card already been used on the card reader
device at the parking entrance, and now it should compute elapsed time and its parking
cost. So, it reads and stores the card variables on the Arduino memory and then resets all
used bytes in card memory. Then, logs out of the card and sounds a beep to indicate that
the process is completed correctly. Here, it recalls Calculate function to compute the total
time and cost.
if(buffer[5]==1)
{
for(byte i=0;i<16;i++)
value1Block[i]=0;
status = mfrc522.MIFARE_Write(valueBlockA, value1B-
lock, 16);
mfrc522.PICC_HaltA();
mfrc522.PCD_StopCrypto1();
buzzer_ok=1;
previousMillis_buzzer=currentMillis;
digitalWrite(alarm_g,HIGH);
digitalWrite(buzzer,HIGH);
calculate();
}
Search WWH ::




Custom Search