21 template <
typename Circuit,
typename Pin>
52 pinMode(this->
pin_, Circuit::PIN_MODE);
89 if(rc) this->stateCount_ = 0;
104 return this->
currState_ == Circuit::BUTTON_PRESSED;
113 return isPressed() && ((millis() - this->millisStart_) >= this->heldTime_);
122 return !
isPressed() && ((millis() - this->millisStart_) >= this->idleTime_);
133 return this->
currState_ == Circuit::BUTTON_RELEASED && this->prevState_ == Circuit::BUTTON_PRESSED;
145 return this->stateCount_ >= 4;
Definition of Pulldown and pull-up ressitor circuits.
Definition of the Pin class and subclasses (DebouncedPin, ClickerPin), providing debounce logic when ...
Resistor circuit base class.
Pin base class reading direct from the pin (without debouncing).
uint8_t pin_
The Arduino pin connected to the button.
void readPin()
Read the pin directly.
uint8_t currState_
The reading of the pin.