define led_pin
This commit is contained in:
parent
5c91330629
commit
6dba8da8b1
1 changed files with 9 additions and 7 deletions
14
the-cup.ino
14
the-cup.ino
|
|
@ -21,6 +21,8 @@
|
||||||
#include <MFRC522DriverPinSimple.h>
|
#include <MFRC522DriverPinSimple.h>
|
||||||
#include <MFRC522Debug.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.
|
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};
|
MFRC522DriverSPI driver_1{ss_1_pin};
|
||||||
|
|
@ -36,7 +38,7 @@ void setup() {
|
||||||
// put your setup code here, to run once:
|
// put your setup code here, to run once:
|
||||||
Serial.begin(115200);
|
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, Local intialization. Once its business is done, there is no need to keep it around
|
||||||
WiFiManager wm;
|
WiFiManager wm;
|
||||||
|
|
@ -100,10 +102,10 @@ void loop() {
|
||||||
// if (httpCode == HTTP_CODE_OK) {
|
// if (httpCode == HTTP_CODE_OK) {
|
||||||
if (httpCode == HTTP_CODE_CREATED) {
|
if (httpCode == HTTP_CODE_CREATED) {
|
||||||
displaySuccess();
|
displaySuccess();
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
displayError();
|
displayError();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
https.end();
|
https.end();
|
||||||
Serial.print("[HTTP] ended...\n");
|
Serial.print("[HTTP] ended...\n");
|
||||||
|
|
@ -125,17 +127,17 @@ void displayError()
|
||||||
{
|
{
|
||||||
for (unsigned int i = 0; i < 6; i++)
|
for (unsigned int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
digitalWrite(LED_BUILTIN, LOW);
|
digitalWrite(LED_PIN, HIGH);
|
||||||
delay(600);
|
delay(600);
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_PIN, LOW);
|
||||||
delay(300);
|
delay(300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void displaySuccess()
|
void displaySuccess()
|
||||||
{
|
{
|
||||||
digitalWrite(LED_BUILTIN, LOW);
|
digitalWrite(LED_PIN, HIGH);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
digitalWrite(LED_BUILTIN, HIGH);
|
digitalWrite(LED_PIN, LOW);
|
||||||
delay(300);
|
delay(300);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue