From c6c70dca7680a4f534f6506a4e17aa85702036f6 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Mon, 22 Dec 2025 21:10:34 +0100 Subject: [PATCH] power rfid only when not sleeping --- the-cup.ino | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/the-cup.ino b/the-cup.ino index 607e839..ea4786e 100644 --- a/the-cup.ino +++ b/the-cup.ino @@ -21,6 +21,7 @@ #define LED_PIN LED_BUILTIN #define SS_PIN SDA +#define RC522_POWER_PIN 1 #define SLEEP_DURATION 1 #define RGB_BRIGHTNESS 4 // Change neopixel brightness (max 255) @@ -74,6 +75,8 @@ void setup() { pinMode(LED_PIN, OUTPUT); + pinMode(RC522_POWER_PIN, OUTPUT); + digitalWrite(RC522_POWER_PIN, HIGH); reader.PCD_Init(); // Init each MFRC522 card. } @@ -85,6 +88,7 @@ void loop() { } else { delay(200); + digitalWrite(RC522_POWER_PIN, LOW); ESP.deepSleep(SLEEP_DURATION * 1000000); } }