blob: bed275b230c92e640a22a18e48ec02b8fd27c982 (
plain)
- /// Mussel - a small library for Arduino to emulate a mussel biosensor
- ///
- /// SPDX-License-Identifier: GPL-3.0-or-later
- /// SPDX-FileCopyrightText: 2025 Jonas Smedegaard <dr@jones.dk>
- ///
- /// @version 0.0.1
- /// @see <https://app.radicle.xyz/nodes/seed.radicle.garden/rad:z2tFBF4gN7ziG9oXtUytVQNYe3VhQ/tree/Mussel/README.md>
- /// @see <https://moodle.ruc.dk/course/view.php?id=23504>
- #ifndef Mussel_h
- #define Mussel_h
- #include "Arduino.h"
- #define MUSSEL_DEBOUNCE_DELAY 50U
- class Mussel {
- public:
- // Default constructor
- Mussel(const int attitude);
- // Constructor for attitudes using a pin
- Mussel(const int attitude, const uint8_t pin);
- // Constructor for attitudes using a pin and certain type of sensor
- Mussel(
- const int attitude,
- const uint8_t pin,
- const uint8_t type);
- void begin();
- String desc();
- byte read();
- String debug();
- private:
- int _attitude;
- int _pin;
- bool _boolState;
- byte _count;
- unsigned long _time;
- #ifdef DHT_H
- DHT mussel_dht;
- #endif
- };
- #endif
|