Commit Graph

12 Commits

Author SHA1 Message Date
GarandPLG 05af6951b0 Localize prompts and fix seat belt logic
Replace English serial messages with Polish, rename `prevUpdate` to
`prevEngineUpdate` for clearer engine timing, simplify RFID checks by
removing unused variables, and correct seat‑belt logic to reset when
distance ≥ 200 cm.
2026-06-17 03:13:22 +02:00
GarandPLG 7585dfe3e9 Refactor seat belt logic for clarity 2026-06-17 01:22:34 +02:00
GarandPLG 0a4a0b862c Enable RFID UID output and tidy car mass input 2026-06-17 01:20:39 +02:00
GarandPLG 6c0a1fc15b Make car mass configurable at runtime
Replace the compile‑time CAR_MASS constant with a runtime‑settable
_member _carMass. Add Engine::setCarMass, default it to 1200 kg, and
use it in the acceleration calculation. Prompt the user for the
car mass on startup via Serial and update the enable/disable messages.
2026-06-17 00:13:16 +02:00
GarandPLG c053a296a5 Add single‑pin Sonar support with periodic reading
Implemented Sonar constructor to use a single shared pin, added mode
flag and
helper method for single‑pin measurements. Updated measure() to select
the
appropriate implementation and added timeout to pulseIn. Integrated
periodic
sonar updates in the main loop, tracking last update time and toggling a
seatBelts flag based on distance thresholds.
2026-06-17 00:03:17 +02:00
GarandPLG 23d5003788 Add PWM motor control and refactor engine update
Introduce ENA pins for both motors and implement rpmToPwm and setMotor.
Replace extensive Serial debug prints with concise motor‑drive logic in
Engine::update. Consolidate sonar pins into a single TRIG_AND_ECHO_PIN.
Update pinMode calls in the sketch to configure the new ENA pins.
2026-06-16 23:35:23 +02:00
GarandPLG 17f888a11c Rename Projekt.ino to Projekt_Arduino.ino
Rename Projekt.ino to Projekt_Arduino.ino

- Rename the main sketch file and adjust references accordingly.
- Clean up Config.h spacing and delete unused turn‑signal constants.
- Remove direction‑related LCD character data and its update logic.
- Introduce Display::startOrEnd to control LCD power on/off.
- Simplify display initialization and eliminate the old delay in the
  loop.
- Add serial debug output for the car enable state.
2026-06-16 22:32:39 +02:00
GarandPLG a80a5bd9a7 Poprawić nazwę pliku głównego 2026-06-16 22:05:46 +02:00
GarandPLG 899212d7b9 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.
2026-06-16 21:56:31 +02:00
GarandPLG febf1215db Remove debug prints, correct reverse gear, tidy loop
- Comment out all Serial debugging statements and the artificial delay
  in
  Engine::update.
- Change reverse gear detection from `gearIdx == 5` to `gearIdx == -1`.
- Simplify the main loop in Projekt.ino by removing unnecessary braces,
  eliminating temporary blink variables, and calling
  `display.updateDirection`
  directly with the pin reads.
2026-06-16 17:32:31 +02:00
GarandPLG b957a0701b Add Engine class and integrate it into Projekt
Add clutch, brake, and throttle pin constants to Config.h.
Implement Engine class in Engine.h/Engine.cpp to read analog inputs,
compute engine RPM, vehicle speed, and apply forces.
Create an Engine instance in Projekt.ino, initialize it in setup,
and update it every 20ms, displaying RPM and speed.
2026-06-16 11:08:56 +02:00
GarandPLG d26fb721f9 init 2026-06-16 01:02:00 +02:00