|
PetCare
|
Controller for managing water levels using a sensor and motor. More...

Public Member Functions | |
| ~WaterLevelController () | |
| Destructor for WaterLevelController. | |
| void | checkWaterLevel (int gpio, int level, uint32_t tick) |
| Function called by the GPIO library when the water level changes. | |
| void | startMotor () |
| Starts the motor if it is not already running. | |
| void | stopMotor () |
| Stops the motor if it is running. | |
Static Public Member Functions | |
| static WaterLevelController * | getInstance () |
| Retrieves the singleton instance of the WaterLevelController. | |
Controller for managing water levels using a sensor and motor.
This singleton class controls the operation of a motor based on the readings from a water level sensor. It ensures that the motor is activated when the water level is below a certain threshold and stops the motor once the water level is adequate.
| void WaterLevelController::checkWaterLevel | ( | int | gpio, |
| int | level, | ||
| uint32_t | tick ) |
Function called by the GPIO library when the water level changes.
| gpio | GPIO pin number that triggered the alert. |
| level | New level of the GPIO pin (high or low). |
| tick | Time at which the change occurred. |
|
inlinestatic |
Retrieves the singleton instance of the WaterLevelController.