Skip to content

Auto Car Program V1.2.0

Pre-release
Pre-release

Choose a tag to compare

@Pilot-Mishari Pilot-Mishari released this 07 Apr 09:44
ce5cca4
  1. 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()).

  1. 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().

  1. 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.

  1. 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).

  1. 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()