aboutsummaryrefslogtreecommitdiff
path: root/Mussel/Mussel.h
blob: 5d85068d462f61b3c81d279fc6e6ed3184c83927 (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. #ifndef Mussel_h
  6. #define Mussel_h
  7. #include "Arduino.h"
  8. #define MUSSEL_DEBOUNCE_DELAY 50U
  9. class Mussel {
  10. public:
  11. // Default constructor
  12. Mussel(const int attitude);
  13. // Constructor for attitudes using a pin
  14. Mussel(const int attitude, const uint8_t pin);
  15. // Constructor for attitudes using a pin and certain type of sensor
  16. Mussel(
  17. const int attitude,
  18. const uint8_t pin,
  19. const uint8_t type);
  20. void begin();
  21. String desc();
  22. byte read();
  23. String debug();
  24. private:
  25. int _attitude;
  26. int _pin;
  27. bool _boolState;
  28. byte _count;
  29. unsigned long _time;
  30. #ifdef DHT_H
  31. DHT mussel_dht;
  32. #endif
  33. };
  34. #endif