We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 650f9e9 commit 1baed55Copy full SHA for 1baed55
libraries/CapacitiveSensor-0.5.1/CapacitiveSensor.cpp
@@ -61,7 +61,8 @@ long CapacitiveSensor::capacitiveSensor(uint8_t samples)
61
// only calibrate if time is greater than CS_AutocaL_Millis and total is less than 10% of baseline
62
// this is an attempt to keep from calibrating when the sensor is seeing a "touched" signal
63
64
- if ( (millis() - lastCal > CS_AutocaL_Millis) && abs(total - leastTotal) < (int)(.10 * (float)leastTotal) ) {
+ if ( (millis() - lastCal > CS_AutocaL_Millis) &&
65
+ abs((signed long)total - (signed long)leastTotal) < (int)(.10 * (float)leastTotal) ) {
66
67
// Serial.println(); // debugging
68
// Serial.println("auto-calibrate");
0 commit comments