DIY fertilizer mixer and plant watering machine https://www.xythobuz.de/giessomat.html
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Plants.h 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #ifndef _PLANTS_H_
  2. #define _PLANTS_H_
  3. #include "GPIOBank.h"
  4. class Plants {
  5. public:
  6. enum Waterlevel {
  7. empty,
  8. inbetween,
  9. full,
  10. invalid
  11. };
  12. // valves: no of plants + 1 for water inlet
  13. // pumps: no of fertilizers
  14. // switches: 2, low and high level
  15. Plants(int valve_count, int pump_count, int switch_count);
  16. void setValvePins(int pins[]);
  17. void setPumpPins(int pins[]);
  18. void setSwitchPins(int pins[], bool pullup);
  19. void abort(void);
  20. Waterlevel getWaterlevel(void);
  21. void openWaterInlet(void);
  22. void closeWaterInlet(void);
  23. int countFertilizers(void);
  24. void startFertilizer(int id);
  25. void stopFertilizer(int id);
  26. void stopAllFertilizers(void);
  27. int countPlants(void);
  28. void startPlant(int id);
  29. void stopPlant(int id);
  30. void stopAllPlants(void);
  31. GPIOBank *getValves(void);
  32. GPIOBank *getPumps(void);
  33. GPIOBank *getSwitches(void);
  34. private:
  35. GPIOBank valves;
  36. GPIOBank pumps;
  37. GPIOBank switches;
  38. };
  39. extern Plants plants;
  40. #endif // _PLANTS_H_