Remove turn signal & sonar, add RFID auth
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.
This commit is contained in:
@@ -4,13 +4,16 @@
|
||||
const int SS_PIN = 10;
|
||||
const int RST_PIN = 7;
|
||||
|
||||
// Kierunkowskazy
|
||||
const int TS_RIGHT = 9;
|
||||
const int TS_LEFT = 8;
|
||||
const byte AUTH_UID[4] = {145, 136, 97, 102};
|
||||
const byte AUTH_UID_SIZE = sizeof(AUTH_UID);
|
||||
|
||||
// Odległościomierz
|
||||
const int TRIG_PIN = 6;
|
||||
const int ECHO_PIN = 5;
|
||||
// // Kierunkowskazy
|
||||
// const int TS_RIGHT = 9;
|
||||
// const int TS_LEFT = 8;
|
||||
|
||||
// // Odległościomierz
|
||||
// const int TRIG_PIN = 6;
|
||||
// const int ECHO_PIN = 5;
|
||||
|
||||
const long SONAR_MAX_DIST_CM = 400;
|
||||
|
||||
@@ -25,7 +28,13 @@ const int GEAR_THRESH_HIGH = 682;
|
||||
const int LCD_COLS = 16;
|
||||
const int LCD_ROWS = 2;
|
||||
|
||||
// Silnik
|
||||
// Skrzynia biegów
|
||||
const uint8_t CLUTCH_PIN = A7;
|
||||
const uint8_t BRAKE_PIN = A2;
|
||||
const uint8_t THROTTLE_PIN = A3;
|
||||
|
||||
// Silniki
|
||||
const int IN_1 = 9;
|
||||
const int IN_2 = 8;
|
||||
const int IN_3 = 4;
|
||||
const int IN_4 = 3;
|
||||
|
||||
Reference in New Issue
Block a user