SkillAgentSearch skills...

Jtouch

PIO based capacitive touch for the RP2040

Install / Use

/learn @AncientJames/Jtouch
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

Software-only capacitive touch for the Raspberry Pi Pico

Any GPIO pin can be used as a capacitive touch sensor.

This code uses a PIO program to detect the capacitance of a finger. First the pin is set to output and pulled low. Then it's set to input with the internal pull up enabled, and the PIO counts how long it takes to go high. There's a tiny difference in the timing of this count depending on whether there's a finger nearby, and by repeating the test thousands of times in a loop, that difference is amplified.

The PIO loops for a fixed length of time (about 16ms, for a 60Hz update rate), and returns a count of the number of charge / discharge cycles.

The Python program tracks the minimum and maximum counts, and turns the current count into a 0-1 level.

https://user-images.githubusercontent.com/14081099/221393030-e98d9114-3211-4b21-a260-b7a585bc5c02.mp4

Related Skills

View on GitHub
GitHub Stars76
CategoryDevelopment
Updated13d ago
Forks6

Languages

Python

Security Score

95/100

Audited on Mar 23, 2026

No findings