The Vehicle Control System is a command-line C program that simulates the internal states of a vehicle based on various sensor inputs. It allows the user to interact with the vehicle's engine, air conditioning (AC), vehicle speed, and engine temperature controller through an interactive menu-driven interface.
- Engine State Management: Turn the vehicle engine ON or OFF, or completely exit the system.
- Traffic Light Sensor (Green - G): Sets speed to 100 km/h.
- Traffic Light Sensor (Orange - O): Sets speed to 30 km/h, automatically turns on the AC, activates the Engine Temperature Control, and recalculates temperatures.
- Traffic Light Sensor (Red - R): Sets speed to 0 km/h.
- Room Temperature Sensor: Monitors the cabin temperature. If the temperature is <= 10°C or >= 30°C, the AC is automatically turned ON and the temperature is stabilized at 20°C.
- Engine Temperature Sensor: Monitors the engine temperature. If the temperature drops to <= 100°C or exceeds >= 150°C, the Engine Temperature Controller is activated to stabilize it at 125°C.
- Dashboard Display: Continuously prints the current vehicle state—including speed, AC status, and temperatures—after every sensor update.
You will need a standard C compiler (such as gcc) installed on your system.
To compile the program, open your terminal, navigate to the directory containing the file, and run the following command:
gcc VehicleControlSystem.c -o VehicleControlSystem