Commit Graph

3 Commits

Author SHA1 Message Date
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 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