31 lines
675 B
C++
31 lines
675 B
C++
#ifndef PinTypeIn_H
|
|
#define PinTypeIn_H
|
|
|
|
#include <Arduino.h>
|
|
#include "DeviceBase.h"
|
|
|
|
class PinTypeIn : public DeviceBase
|
|
{
|
|
private:
|
|
uint8_t _pin;
|
|
unsigned long _debounceDelay;
|
|
unsigned long _lastDebounceTime;
|
|
int _lastButtonState;
|
|
int _buttonState;
|
|
|
|
public:
|
|
const char *description;
|
|
|
|
PinTypeIn(String id, uint8_t pin, unsigned long debounceDelay, const char *description): DeviceBase(id), _pin(pin), _debounceDelay(debounceDelay)
|
|
{
|
|
this->description = description;
|
|
pinMode(pin, INPUT);
|
|
}
|
|
|
|
/// @brief Get Actual Pin Value if is SET = True, if is NOT SET = False
|
|
/// @return
|
|
bool IsPinHigh();
|
|
|
|
};
|
|
|
|
#endif |