use neopixel for visual feedback
This commit is contained in:
parent
352c005763
commit
423c9ea5c7
1 changed files with 6 additions and 2 deletions
|
|
@ -23,6 +23,8 @@
|
||||||
#define SS_PIN SDA
|
#define SS_PIN SDA
|
||||||
#define SLEEP_DURATION 1
|
#define SLEEP_DURATION 1
|
||||||
|
|
||||||
|
#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};
|
||||||
|
|
@ -110,11 +112,13 @@ void byte_to_string(byte array[], unsigned int len, char buffer[]) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void displayError() {
|
void displayError() {
|
||||||
blink(6, 300);
|
rgbLedWrite(RGB_BUILTIN, RGB_BRIGHTNESS, 0, 0); // Green
|
||||||
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void displaySuccess() {
|
void displaySuccess() {
|
||||||
blink(1, 1000);
|
rgbLedWrite(RGB_BUILTIN, 0, RGB_BRIGHTNESS, 0); // Green
|
||||||
|
delay(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
void blink(unsigned int times, unsigned int duration) {
|
void blink(unsigned int times, unsigned int duration) {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue