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 1003B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  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. private:
  32. GPIOBank valves;
  33. GPIOBank pumps;
  34. GPIOBank switches;
  35. };
  36. extern Plants plants;
  37. #endif // _PLANTS_H_