vail-adapter/touchbounce.cpp

12 lines
233 B
C++
Raw Normal View History

2022-05-21 20:14:03 -06:00
#include "touchbounce.h"
void TouchBounce::attach(int pin) {
this->qt = Adafruit_FreeTouch(pin);
this->qt.begin();
}
bool TouchBounce::readCurrentState() {
int val = this->qt.measure();
return val < QT_THRESHOLD;
}