Hey, maybe I can help you, I’ve had the same problem for quite sometime but solved it like this.
•first make sure you have the right resistor (very important) if you don’t it will give you a zero, in your post you said you are using a 10k resistor, you’ll need at least a 220k to get a response, they are asking for a 10Mega ohm I believe.
•follow the tutorial and if you have only one sensor, set your codes like this, I’ve realized that having multiple sensors active when you only need one messes up everything.
* CapitiveSense Library Demo Sketch
* Paul Badger 2008
* Uses a high value resistor e.g. 10M between send pin and receive pin
* Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values.
* Receive pin is the sensor pin - try different amounts of foil/metal on this pin
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired
cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate on channel 1 - just as an example
long start = millis();
long total1 = cs_4_2.capacitiveSensor(30);
// tab character for debug windown spacing
Serial.println(total1); // print sensor output 1
delay(30); // arbitrary delay to limit data to serial port
this should work,
have a nice day,