Repository navigation
Auto Car Program V1.2.0
Pre-release- Hardware Fixes
Fixed ultrasonic sensor pins:
Separated front (trigFront=13, echoFront=12) and back (trigBack=11, echoBack=2) sensors.
Corrected checkBack() to use dedicated back sensor pins.
Motor direction fixes:
Fixed reversers() to use BACKWARD instead of FORWARD.
Added proper motor control functions (moveForward(), moveBackward()).
- Feature Implementations
Automatic Lighting:
Added checkLighting() to toggle lights based on ambient light (LightIntensity).
Integrated daytime/nighttime modes with isDaytime flag.
Cruise Control:
Added basic cruise control (maintainCruiseSpeed()).
Implemented adaptive cruise (adjusts speed based on frontDist).
Autopilot:
Basic obstacle avoidance in runAutopilot() (turns left/right based on distances).
IR Remote:
Added missing commands (U-turn, adaptive cruise toggle).
Fixed speed increment/decrement logic with constrain().
- Code Structure Improvements
New Functions:
setMotorSpeed(): Safely constrains speed to 0–255.
measureDistances(): Centralized ultrasonic sensor readings.
getDistance(): Reusable distance measurement logic.
Indicator Lights:
Non-blocking leftIndicator()/rightIndicator() (still uses delay() but shorter).
Brake Lights:
updateBrakeLights() now responds to speed changes.
- Bug Fixes
Recursive Calls: Removed checkFront() recursion in accelerate().
Motor Speed Overflow: Constrained mSpd to 0–255 in IR remote handler.
Lighting Logic: Fixed lightValue thresholds (now toggles at 300).
- Known Limitations
Parking Assist: Not yet implemented (requires additional sensors).
AI Traffic Learning: Not included (future update).
Non-Blocking Delays: Indicators still use delay() (could be improved with millis()