Can a capacitative touch switch provide multiple response levels?
Andy, welcome to the board. Capacitive touch sensing is inherently analog, that is, the sensor outputs a continuous range of values, depending on the amount of external capacitance added to the pin. To convert this to a digital result, the code sets a threshold value. Above that, it reports &quot;touch&quot;, and below, it reports &quot;no-touch&quot;. There's nothing to prevent you from setting two thresholds, so you get three possible digital results, like &quot;no-touch&quot;, &quot;light-touch&quot;, &quot;heavy-touch&quot;.
Commenters have validly noted that this might not be reliable enough for a commercial product, but I encourage you to try it and learn from the experience.
Think about the curvature of your fingertip and how it contacts a touchswitch pad. As you press harder, the curvature flattens out against the pad, so there is more surface area in contact, which increases the capacitance compared to a light touch where only a small area of your finger contacts the pad. I'd guess the touch pad should be about the size of your fingertip. If it's too small (as for example if you are just using a wire to experiment) there might be no difference between light and heavy touches. So be sure to try an actual flat or curved pad. Use touchRead() to sense the value and print it out on the serial monitor, running in a loop, while you experiment. Have fun and gain knowledge!