deep sleep when no card

This commit is contained in:
Christophe Robillard 2025-12-21 21:52:43 +01:00
parent b1bdc9b840
commit 5f6a52f6a2

View file

@ -70,6 +70,7 @@ void send_uid(char reader_uid[]);
void setup() {
Serial.begin(115200);
delay(1000);
pinMode(LED_PIN, OUTPUT);
@ -82,6 +83,10 @@ void loop() {
read_card(reader_uid);
send_uid(reader_uid);
}
else {
delay(200);
ESP.deepSleep(SLEEP_DURATION * 1000000);
}
}
void read_card(char reader_uid[]) {
@ -132,7 +137,6 @@ void send_uid(char reader_uid[]) {
https.end();
Serial.print("[HTTPS] ended...\n");
ESP.deepSleep(SLEEP_DURATION * 1000000);
}
void byte_to_string(byte array[], unsigned int len, char buffer[]) {