From 6dba8da8b1f6ebe4da4f4669871d0e893de7c0c1 Mon Sep 17 00:00:00 2001 From: Christophe Robillard Date: Sat, 27 Sep 2025 11:45:54 +0200 Subject: [PATCH] define led_pin --- the-cup.ino | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/the-cup.ino b/the-cup.ino index 4e61b01..f3df540 100644 --- a/the-cup.ino +++ b/the-cup.ino @@ -21,6 +21,8 @@ #include #include +#define LED_PIN 16 + MFRC522DriverPinSimple ss_1_pin(4); // Configurable, take an unused pin, only HIGH/LOW required, must be different to SS 2. MFRC522DriverSPI driver_1{ss_1_pin}; @@ -36,7 +38,7 @@ void setup() { // put your setup code here, to run once: Serial.begin(115200); - pinMode(LED_BUILTIN, OUTPUT); + pinMode(LED_PIN, OUTPUT); //WiFiManager, Local intialization. Once its business is done, there is no need to keep it around WiFiManager wm; @@ -100,9 +102,9 @@ void loop() { // if (httpCode == HTTP_CODE_OK) { if (httpCode == HTTP_CODE_CREATED) { displaySuccess(); - } - } else { + } else { displayError(); + } } https.end(); @@ -125,17 +127,17 @@ void displayError() { for (unsigned int i = 0; i < 6; i++) { - digitalWrite(LED_BUILTIN, LOW); + digitalWrite(LED_PIN, HIGH); delay(600); - digitalWrite(LED_BUILTIN, HIGH); + digitalWrite(LED_PIN, LOW); delay(300); } } void displaySuccess() { - digitalWrite(LED_BUILTIN, LOW); + digitalWrite(LED_PIN, HIGH); delay(1000); - digitalWrite(LED_BUILTIN, HIGH); + digitalWrite(LED_PIN, LOW); delay(300); }