I have an Adafruit circuit playground classic, and the touch-pads are so very sensitive. From a centimeter away, they trigger. I would be happy to just have regular inputs, or to have the sensitivity reduced. How can I do this?

To clarify, here is my code:

//keyboard control for TuxKart power Glove
#include <Adafruit_CircuitPlayground.h>
#include <Keyboard.h>
#include <Mouse.h>
// set pin numbers for the five buttons:
const int Fire = 6;
const int Nitro = 9;
const int Eagle = 10;
const int _Esc = 12;

bool slideSwitch;

void setup() { // initialize the buttons' inputs:
  pinMode(Fire, INPUT_PULLUP);
  pinMode(Nitro, INPUT_PULLUP);
  pinMode(Eagle, INPUT_PULLUP);
  pinMode(_Esc, INPUT_PULLUP);

  // initialize mouse control:

void loop() {
  if (!CircuitPlayground.slideSwitch()) {

  // use the pushbuttons to control the keyboard:
  if (!digitalRead(Fire) == HIGH) {
  if (!digitalRead(Nitro) == HIGH) {
  if (!digitalRead(Eagle) == HIGH) {
  if (!digitalRead(_Esc) == HIGH) {

This code or any other, where capacitive touch sensitivity has not been specified, yields pins having extreme sensitivity. I have read the comments, that say the MCU doesn't feature this natively. If that were true, how would the pins remain sensitive?

My solution to this is to set sensitivity so low, that it is negligible. If capacitive touch sensing is not specified, why am I getting that functionality? Why would this code give me capacitive touch sensing? Ideally, I would disable the touch sensing somehow, or have the pins simply behave normally, like any other Arduino based device that doesn't have touch sense. But what I have guessed, (shown in code) doesn't work. If there is a more explicit way to specify that IO pins should act as normal pins, without capacitive touch sensing, I would surely like to know.

  • 4
    Please edit your question to include part numbers and links to part descriptions. Also a good idea to include a Minimal, Complete, and Verifiable example of code, to show what libraries you are using to read the sensors Commented Jul 9, 2017 at 13:11
  • 1
    How do you do the capacitive sensing? Libraries? Code? This information is still missing. Commented Jul 9, 2017 at 13:48
  • Im not doing it, in code, the hardware is doing it automaticly. I havent figured out how to disable it. I hoped that by not having it in code, that the functionality wouldn't be active, but it would seem to be the opposite
    – j0h
    Commented Jul 9, 2017 at 15:30
  • 2
    You wrote: “Im not doing it, in code, the hardware is doing it automaticly”. Wrong. This board is based on the ATmega32u4, which does not natively support touch sensing. I can detect touch with the appropriate code/library, but it cannot do it in a hardware-only way. Commented Jul 10, 2017 at 13:45
  • Then how do i get functionality of capacitive touch, if my code doesn't use it. Why isnt it just disabled? I'm here for answers, guys, basing my questions on observations. If i knew already, I wouldn't be asking.
    – j0h
    Commented Jul 11, 2017 at 23:37

2 Answers 2


digitalRead(pin) is the wrong way to read capacitive touch inputs.

In the file from the example you linked in your answer, the reading is made by calling CircuitPlayground.readCap(pin, num_samples) and then the returning value is compared to a threshold.

const uint16_t TOUCH_THRESHOLD = 300;


if (CircuitPlayground.readCap(Fire) >= TOUCH_THRESHOLD) {

You can change the sensitivity by changing TOUCH_THRESHOLD. You could also add and fiddle with the second argument to change the number of samples.


Its not the best method for finding a solution, perhaps, but I was tooling around in the Adafruit_CircuitPalyground repo, and found a macro for the Capacitive touch sensitivity.

The macro is:

#define CAP_THRESHOLD 300 // Threshold for a capacitive touch (higher = less sensitive).

Located here: https://github.com/adafruit/Adafruit_CircuitPlayground/search?utf8=%E2%9C%93&q=CAP_THRESHOLD&type=

I'm reading more, and trying to find the libraries for capacitive touch. There may be a much better solution, but for now defining CAP_THRESHOLD works well enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.