use rgb led
This commit is contained in:
parent
45d6421f32
commit
4e59d647aa
1 changed files with 10 additions and 4 deletions
14
the-cup.ino
14
the-cup.ino
|
|
@ -20,8 +20,12 @@
|
||||||
#include <MFRC522Debug.h>
|
#include <MFRC522Debug.h>
|
||||||
|
|
||||||
#define SS_PIN SDA
|
#define SS_PIN SDA
|
||||||
|
#define DEBUG
|
||||||
|
|
||||||
|
const int RED_PIN = 5;
|
||||||
|
const int GREEN_PIN = 6;
|
||||||
|
const int BLUE_PIN = 7;
|
||||||
|
|
||||||
#define RGB_BRIGHTNESS 4 // Change neopixel brightness (max 255)
|
|
||||||
|
|
||||||
MFRC522DriverPinSimple ss_1_pin(SS_PIN); // Configurable, take an unused pin, only HIGH/LOW required, must be different to SS 2.
|
MFRC522DriverPinSimple ss_1_pin(SS_PIN); // 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};
|
||||||
|
|
@ -129,7 +133,7 @@ void postUid(char reader_uid[]) {
|
||||||
Serial.print("[HTTPS] begin...\n");
|
Serial.print("[HTTPS] begin...\n");
|
||||||
#endif
|
#endif
|
||||||
// configure traged server and url
|
// configure traged server and url
|
||||||
https.begin("https://mood.robiweb.net/rfid_tags"); // HTTP
|
https.begin("https://robi.kluk.fr/rfid_tags"); // HTTP
|
||||||
https.addHeader("Content-Type", "application/json");
|
https.addHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
// start connection and send HTTP header and body
|
// start connection and send HTTP header and body
|
||||||
|
|
@ -172,11 +176,13 @@ void byte_to_string(byte array[], unsigned int len, char buffer[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayError() {
|
void displayError() {
|
||||||
rgbLedWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Red
|
analogWrite(RED_PIN, 200);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
analogWrite(RED_PIN, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displaySuccess() {
|
void displaySuccess() {
|
||||||
rgbLedWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green
|
analogWrite(GREEN_PIN, 200);
|
||||||
delay(1000);
|
delay(1000);
|
||||||
|
analogWrite(GREEN_PIN, 0);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue