Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/todbot/touchytouch
Capacitive sense (capsense) touch Arduino library that mimics how CircuitPython touchio work
https://github.com/todbot/touchytouch
arduino capacitive capsense circuitpython rp2040 sense touch touchio
Last synced: 18 days ago
JSON representation
Capacitive sense (capsense) touch Arduino library that mimics how CircuitPython touchio work
- Host: GitHub
- URL: https://github.com/todbot/touchytouch
- Owner: todbot
- License: mit
- Created: 2024-02-05T02:18:08.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-02-05T19:47:13.000Z (10 months ago)
- Last Synced: 2024-10-10T22:41:05.576Z (about 1 month ago)
- Topics: arduino, capacitive, capsense, circuitpython, rp2040, sense, touch, touchio
- Language: C++
- Homepage:
- Size: 9.77 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# TouchyTouch
Capacitive sense touch Arduino library that mimics how CircuitPython `touchio` works.
This library emulates how the CircuitPython touchio library implements capacitive touch sensing.
It also includes basic button debouncing.It is based on the CircuitPython "touchio" code at: https://github.com/adafruit/circuitpython/blob/main/shared-module/touchio/TouchIn.c
The `touchio` code is not platform-specific, but does require a 1M pull-down resistor.Thus the `TouchyTouch` Arduino library is also not platform-specific and also requires a pull-down resistor.
### How it works:
From the `touchio` C code:
```
// This is a capacitive touch sensing routine using a single digital
// pin. The pin should be connected to the sensing pad, and to ground
// via a 1Mohm or thereabout drain resistor. When a reading is taken,
// the pin's capacitance is charged by setting it to a digital output
// 'high' for a few microseconds, and then it is changed to a high
// impedance input. We measure how long it takes to discharge through
// the resistor (around 50us), using a busy-waiting loop, and average
// over N_SAMPLES cycles to reduce the effects of noise.
```