CrossGuard
|
Implements traffic light control specifically for cars. More...
#include <CarsTrafficLightSystem.h>
Public Member Functions | |
CarsTrafficLightSystem () | |
Constructs a new Cars Traffic Light System object. | |
void | initialize () |
Initializes the traffic light system. | |
void | run () |
Runs the main logic of the traffic light control. | |
void | deactivate () |
Deactivates the traffic light system. | |
Public Member Functions inherited from TrafficLight | |
TrafficLight (int redPin, int greenPin) | |
Constructor for a traffic light with specified pins for the red and green LEDs. | |
TrafficLight (int redPin, int greenPin, int yellowPin) | |
Constructor for a traffic light with specified pins for the red, green, and yellow LEDs. | |
void | turnRed () |
Sets the traffic light to red. | |
void | turnGreen () |
Sets the traffic light to green. | |
void | turnYellow () |
Sets the traffic light to yellow. | |
void | turnOff () |
Turns off all lights. | |
Additional Inherited Members | |
Public Types inherited from TrafficLight | |
enum class | State { OFF , RED , GREEN , YELLOW } |
Represents the possible states of a traffic light. More... | |
Implements traffic light control specifically for cars.
Inherits from TrafficLight and provides methods to initialize, activate, run, and deactivate the traffic light system. This class uses atomic variables to manage state in a thread-safe manner.
CarsTrafficLightSystem::CarsTrafficLightSystem | ( | ) |
Constructs a new Cars Traffic Light System object.
Initializes the traffic light system with specific pins for red, green, and yellow lights.
void CarsTrafficLightSystem::deactivate | ( | ) |
Deactivates the traffic light system.
Turns off all lights and marks the system as inactive.
void CarsTrafficLightSystem::initialize | ( | ) |
Initializes the traffic light system.
Placeholder for initialization code, if any additional setup is required.
void CarsTrafficLightSystem::run | ( | ) |
Runs the main logic of the traffic light control.
Placeholder for the main operational logic of the traffic light system.