-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Nickzoic/circuitpython nrf touchin 1048 #1499
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nickzoic/circuitpython nrf touchin 1048 #1499
Conversation
|
Manually tested on Feather NRF52832 and Feather NRF52840 Express boards, with code like: |
|
How about auto setting a threshold on object creation? That's what the SAMD does already. That way folks don't need to set it themselves before using it. |
|
Sure, we can totally do that. I'll add it in.
|
|
Threshold is now automatically set: I've adjusted the example code accordingly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you!
|
tested, works well - thanks! |
A much-simplified approach to touch sensing for #1048 !
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.