Skip to content
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

Optimize touch sensing #3

Open
KravitzLab opened this issue Dec 14, 2024 · 4 comments
Open

Optimize touch sensing #3

KravitzLab opened this issue Dec 14, 2024 · 4 comments

Comments

@KravitzLab
Copy link
Member

Our current method of touch sensing is not 100% reliable at determining which touchpad woke the ESP32. We need to optimize this.

Touch documentation is here:
https://docs.espressif.com/projects/esp-idf/en/stable/esp32s3/api-reference/peripherals/touch_pad.html#_CPPv420touch_pad_get_statusv

@mattgaidica
Copy link
Collaborator

I believe I tried touch_pad_get_status() but it tossed a compilation error. I'm less and less impressed with their examples, as they're so bare bones, but this should be ground truth: https://github.com/espressif/arduino-esp32/blob/64b62dc45b008bc578a9918d3b9d537cd07d6ce9/libraries/ESP32/examples/Touch/TouchInterrupt/TouchInterrupt.ino#L14

We tried that (twice I think!) and it was unreliable.

@KravitzLab
Copy link
Member Author

KravitzLab commented Dec 14, 2024 via email

@KravitzLab
Copy link
Member Author

New example here that seems to work better. The important things are:

  1. attach T1, T5, and T6 to independent ISRs that keep track of flags for which touchpad was triggered
  2. include a 100ms debounce in the ISRs so only one flag can be true at a time

@KravitzLab
Copy link
Member Author

Example moved here - try implementing this on FED4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants