54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
/* ===================================================================================
|
|
* MAIN LOOP
|
|
* =================================================================================*/
|
|
|
|
void _loop()
|
|
{
|
|
// Reading The RFID
|
|
String card = rfid_read();
|
|
|
|
// Checking Card Content
|
|
if(card != "")
|
|
{
|
|
// Reset The Timer
|
|
blink.Reset();
|
|
|
|
// Turn On The LED
|
|
lcd_light_on();
|
|
|
|
// Display
|
|
lcd_line1("CARD: " + card);
|
|
|
|
// Send to Server
|
|
String payload = read_payload(prepare_HTTPData(server, card));
|
|
|
|
// Reading The Payload
|
|
person_read(payload);
|
|
|
|
// Wait For LED To Turn OFF
|
|
while(!blink.Trigger())
|
|
{
|
|
// Clearing Watch Dog Timer
|
|
//ESP.wdtFeed();
|
|
}
|
|
|
|
// Turn Off The Light
|
|
lcd_light_off();
|
|
|
|
// Clearing Display
|
|
lcd_clear();
|
|
|
|
// Clearing The Blink Counter
|
|
testWiFi.Reset();
|
|
}
|
|
|
|
// Clearing Watch Dog Timer
|
|
//ESP.wdtFeed();
|
|
|
|
// This Indicates That WiFi Is Alive
|
|
if(testWiFi.Trigger() && checkWiFi() == true)
|
|
{
|
|
digitalWrite(D4, !digitalRead(D4));
|
|
}
|
|
}
|