CrossGuard
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
WarningSystem Class Reference

Manages a warning system with three LEDs and a buzzer. More...

#include <WarningSystem.h>

Inheritance diagram for WarningSystem:
SystemInterface

Public Member Functions

 WarningSystem ()
 Constructs a new Warning System instance.
 
void initialize () override
 Initializes the warning system components.
 
void activate () override
 Activates the warning system.
 
void deactivate () override
 Deactivates the warning system.
 
- Public Member Functions inherited from SystemInterface
virtual ~SystemInterface ()
 Virtual destructor.
 

Static Public Attributes

static const int ledPin = Constants::WarningSystemLedPin
 Pin number for the first LED.
 
static const int ledPin2 = Constants::WarningSystemLed2Pin
 Pin number for the second LED.
 
static const int ledPin3 = Constants::WarningSystemLed3Pin
 Pin number for the third LED.
 
static const int buzzerPin = Constants::WarningSystemBuzzerPin
 Pin number for the buzzer.
 

Detailed Description

Manages a warning system with three LEDs and a buzzer.

Inherits from SystemInterface, requiring implementation of initialization, activation, and deactivation methods. Utilizes predefined pin numbers from the Constants class for LED and buzzer components.

Constructor & Destructor Documentation

◆ WarningSystem()

WarningSystem::WarningSystem ( )

Constructs a new Warning System instance.

Constructor for WarningSystem initializes hardware components.

Initializes LEDs and buzzer with predefined pins from Constants. The system is not initialized by default.

The constructor initializes LED and Buzzer objects using predefined pins from the Constants class. Initially sets the system to an uninitialized state.

Member Function Documentation

◆ activate()

void WarningSystem::activate ( )
overridevirtual

Activates the warning system.

Activates the warning system by turning on all LEDs and the buzzer.

Turns on all LEDs and the buzzer if the system has been initialized.

If the system has been initialized, this method activates all three LEDs and the buzzer to signal a warning state.

Implements SystemInterface.

◆ deactivate()

void WarningSystem::deactivate ( )
overridevirtual

Deactivates the warning system.

Deactivates the warning system by turning off all LEDs and the buzzer.

Turns off all LEDs and the buzzer if the system has been initialized.

Ensures that all warning signals are turned off if the system has been initialized, returning the system to a non-alert state.

Implements SystemInterface.

◆ initialize()

void WarningSystem::initialize ( )
overridevirtual

Initializes the warning system components.

Initializes the warning system by setting all components to the off state.

Sets all LEDs and the buzzer to their off state and marks the system as initialized.

This method prepares the system for operation by ensuring all LEDs and the buzzer start in the off state and sets the system as initialized.

Implements SystemInterface.


The documentation for this class was generated from the following files: