aboutsummaryrefslogtreecommitdiff
path: root/Mussel/Mussel.h
blob: bed275b230c92e640a22a18e48ec02b8fd27c982 (plain)
  1. /// Mussel - a small library for Arduino to emulate a mussel biosensor
  2. ///
  3. /// SPDX-License-Identifier: GPL-3.0-or-later
  4. /// SPDX-FileCopyrightText: 2025 Jonas Smedegaard <dr@jones.dk>
  5. ///
  6. /// @version 0.0.1
  7. /// @see <https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z2tFBF4gN7ziG9oXtUytVQNYe3VhQ/tree/Mussel/README.md>
  8. /// @see <https://moodle.ruc.dk/course/view.php?id=23504>
  9. #ifndef Mussel_h
  10. #define Mussel_h
  11. #include "Arduino.h"
  12. #define MUSSEL_DEBOUNCE_DELAY 50U
  13. class Mussel {
  14. public:
  15. // Default constructor
  16. Mussel(const int attitude);
  17. // Constructor for attitudes using a pin
  18. Mussel(const int attitude, const uint8_t pin);
  19. // Constructor for attitudes using a pin and certain type of sensor
  20. Mussel(
  21. const int attitude,
  22. const uint8_t pin,
  23. const uint8_t type);
  24. void begin();
  25. String desc();
  26. byte read();
  27. String debug();
  28. private:
  29. int _attitude;
  30. int _pin;
  31. bool _boolState;
  32. byte _count;
  33. unsigned long _time;
  34. #ifdef DHT_H
  35. DHT mussel_dht;
  36. #endif
  37. };
  38. #endif