899212d7b9
Define AUTH_UID and AUTH_UID_SIZE constants. Introduce motor control pins IN_1‑IN_4 and set them as outputs. Comment out turn‑signal and sonar pin definitions and related code. Refactor Display to remove updateDirection functionality. Extend RFIDReader with reset() and matches() methods; use them to toggle carEnabled based on RFID authentication. Update the main loop to operate only when the RFID tag matches the authorized UID.
32 lines
710 B
C++
32 lines
710 B
C++
#pragma once
|
|
#include <rgb_lcd.h>
|
|
#include <Arduino.h>
|
|
|
|
enum LcdChar : uint8_t {
|
|
CHAR_LEFT = 0,
|
|
CHAR_RIGHT = 1,
|
|
CHAR_LEFT_BLINK = 2,
|
|
CHAR_RIGHT_BLINK = 3
|
|
};
|
|
|
|
class Display {
|
|
public:
|
|
void begin(int cols, int rows);
|
|
|
|
void updateSpeed(int kmh);
|
|
|
|
void updateRPM(int rpm);
|
|
|
|
void updateGear(char gearChar);
|
|
|
|
// void updateDirection(bool leftOn, bool rightOn);
|
|
|
|
private:
|
|
rgb_lcd _lcd;
|
|
|
|
byte _leftChar[8] = { 0x00, 0x04, 0x08, 0x1F, 0x1F, 0x08, 0x04, 0x00 };
|
|
byte _leftCharBlink[8] = { 0x1F, 0x1B, 0x17, 0x00, 0x00, 0x17, 0x1B, 0x1F };
|
|
byte _rightChar[8] = { 0x00, 0x04, 0x02, 0x1F, 0x1F, 0x02, 0x04, 0x00 };
|
|
byte _rightCharBlink[8] = { 0x1F, 0x1B, 0x1D, 0x00, 0x00, 0x1D, 0x1B, 0x1F };
|
|
};
|