display success at some steps
This commit is contained in:
parent
6dba8da8b1
commit
7fb45773fe
1 changed files with 8 additions and 12 deletions
18
the-cup.ino
18
the-cup.ino
|
|
@ -29,8 +29,6 @@ MFRC522DriverSPI driver_1{ss_1_pin};
|
||||||
|
|
||||||
MFRC522 reader{driver_1}; // Create MFRC522 instance.
|
MFRC522 reader{driver_1}; // Create MFRC522 instance.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
// WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
// WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
||||||
// it is a good practice to make sure your code sets wifi mode how you want it.
|
// it is a good practice to make sure your code sets wifi mode how you want it.
|
||||||
|
|
@ -39,6 +37,7 @@ void setup() {
|
||||||
Serial.begin(115200);
|
Serial.begin(115200);
|
||||||
|
|
||||||
pinMode(LED_PIN, OUTPUT);
|
pinMode(LED_PIN, OUTPUT);
|
||||||
|
displaySuccess();
|
||||||
|
|
||||||
//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;
|
||||||
|
|
@ -65,11 +64,10 @@ void setup() {
|
||||||
else {
|
else {
|
||||||
//if you get here you have connected to the WiFi
|
//if you get here you have connected to the WiFi
|
||||||
Serial.println("connected...yeey :)");
|
Serial.println("connected...yeey :)");
|
||||||
|
displaySuccess();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
reader.PCD_Init(); // Init each MFRC522 card.
|
reader.PCD_Init(); // Init each MFRC522 card.
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
@ -108,11 +106,11 @@ void loop() {
|
||||||
}
|
}
|
||||||
|
|
||||||
https.end();
|
https.end();
|
||||||
Serial.print("[HTTP] ended...\n");
|
Serial.print("[HTTPS] ended...\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
void array_to_string(byte array[], unsigned int len, char buffer[])
|
|
||||||
{
|
void array_to_string(byte array[], unsigned int len, char buffer[]) {
|
||||||
for (unsigned int i = 0; i < len; i++)
|
for (unsigned int i = 0; i < len; i++)
|
||||||
{
|
{
|
||||||
byte nib1 = (array[i] >> 4) & 0x0F;
|
byte nib1 = (array[i] >> 4) & 0x0F;
|
||||||
|
|
@ -123,8 +121,7 @@ void array_to_string(byte array[], unsigned int len, char buffer[])
|
||||||
buffer[len*2] = '\0';
|
buffer[len*2] = '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayError()
|
void displayError() {
|
||||||
{
|
|
||||||
for (unsigned int i = 0; i < 6; i++)
|
for (unsigned int i = 0; i < 6; i++)
|
||||||
{
|
{
|
||||||
digitalWrite(LED_PIN, HIGH);
|
digitalWrite(LED_PIN, HIGH);
|
||||||
|
|
@ -134,8 +131,7 @@ void displayError()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void displaySuccess()
|
void displaySuccess() {
|
||||||
{
|
|
||||||
digitalWrite(LED_PIN, HIGH);
|
digitalWrite(LED_PIN, HIGH);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
digitalWrite(LED_PIN, LOW);
|
digitalWrite(LED_PIN, LOW);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue