MCPcopy Create free account
hub / github.com/PaulStoffregen/CapacitiveSensor / capacitiveSensorRaw

Method capacitiveSensorRaw

CapacitiveSensor.cpp:108–119  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

106}
107
108long CapacitiveSensor::capacitiveSensorRaw(uint8_t samples)
109{
110 total = 0;
111 if (samples == 0) return 0;
112 if (error < 0) return -1; // bad pin - this appears not to work
113
114 for (uint8_t i = 0; i < samples; i++) { // loop for samples parameter - simple lowpass filter
115 if (SenseOneCycle() < 0) return -2; // variable over timeout
116 }
117
118 return total;
119}
120
121
122void CapacitiveSensor::reset_CS_AutoCal(void){

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected