PetCare
|
Class to handle weight measurements using a digital scale sensor. More...
Public Member Functions | |
~WeightSensor () | |
Destructor for WeightSensor. | |
void | start () |
Start the weight measurement process. | |
void | stop () |
Stop the weight measurement process. | |
int | getLatestWeight () const |
Get the latest measured weight. | |
int | readWeight () |
Read and calculate the current weight from the sensor. | |
Static Public Member Functions | |
static WeightSensor * | getInstance () |
Retrieves the singleton instance of the WeightSensor. | |
Class to handle weight measurements using a digital scale sensor.
This singleton class provides an interface for reading weight measurements from a digital scale. It initializes the necessary GPIO pins for communication with the sensor and provides methods to start and stop the measurement process, as well as to read the weight values.
|
inlinestatic |
Retrieves the singleton instance of the WeightSensor.
int WeightSensor::getLatestWeight | ( | ) | const |
Get the latest measured weight.
int WeightSensor::readWeight | ( | ) |
Read and calculate the current weight from the sensor.