make a lot of things better

This commit is contained in:
2023-07-05 02:38:18 +02:00
parent e4c5ddb9ab
commit ac995522db
6 changed files with 62 additions and 33 deletions
+4 -2
View File
@@ -13,7 +13,7 @@ class Valve {
uint32_t startTime;
};
Valve();
Valve(uint8_t maxOpen);
void loop();
@@ -24,7 +24,8 @@ class Valve {
void close(uint8_t valveNumber);
void closeAll();
uint8_t getNumOfOpen();
uint8_t getNumOfOpen() const;
uint8_t getMaxOpen() const { return this->maxOpen; }
uint16_t getTimeLeft(uint8_t valveNumber);
private:
@@ -33,6 +34,7 @@ class Valve {
ShiftRegister* shiftRegister = nullptr;
ValveData valves[MAX_VALVES];
uint8_t maxOpen;
uint8_t valveCount = 0;
uint16_t loopDelay = 1000;
uint32_t loopLastMillis = 0;