define led_pin
This commit is contained in:
parent
5c91330629
commit
6dba8da8b1
1 changed files with 9 additions and 7 deletions
16
the-cup.ino
16
the-cup.ino
|
|
@ -21,6 +21,8 @@
|
|||
#include <MFRC522DriverPinSimple.h>
|
||||
#include <MFRC522Debug.h>
|
||||
|
||||
#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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue