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