Is there a simple way to use the 16 key touchpad (TTP229) with Particle?


If you use Serial.print(val, BIN); you’ll see the binary representation.

And your keypads have the numbers [0] and [1], printing [2] will show you the contents of the memory location following the reserved space (= not your btnState)
Arrays in C always start with index zero!


OK, I see!

I changed the print commands to:

Serial.print(btnState[0], BIN);
Serial.print(" - ");
Serial.println(btnState[1], BIN);

Now I see this in the serial monitor:

0 - 1000000000000
1000000 - 0

One step forward…


How to Chang ttp229 address in i2c ?or how to identify two ttp229 device on i2c protocol ?


Did you read this?

You need to check whether you are using the -L or the -B version of the chip.