| 106 | } |
| 107 | |
| 108 | long 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 | |
| 122 | void CapacitiveSensor::reset_CS_AutoCal(void){ |
nothing calls this directly
no outgoing calls
no test coverage detected