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

Touch and Hold to register a touch #2

Open
LiveRock opened this issue Jun 29, 2022 · 6 comments
Open

Touch and Hold to register a touch #2

LiveRock opened this issue Jun 29, 2022 · 6 comments

Comments

@LiveRock
Copy link

Hi

Do you have a sample to implement a 'Touch and Hold' to register a touch?

The docs say check out:

The press and hold is controlled via a register:
https://ww1.microchip.com/downloads/aemDocuments/documents/OTH/ProductDocuments/DataSheets/00001571B.pdf

Any tips?

@ChrisBall
Copy link
Owner

Afraid not! This library was only put together to test whether the CAP1298 was suitable for something I was working on - it wasn't. I didn't take it any further than I needed to, so most functionality is not implemented.

That said, you should be able to enable repeats with register CAP1298_RPTRATEENABLE (0x28), then fine tune the hold/repeat times in registers CAP1298_SENSINPUTCONFIG1 (0x22) and CAP1298_CONFIG2 (0x44). This is briefly described in section 4.9.2 of the datasheet.

I'd be happy to put together an example and modify the library to support touch and hold configuration - but it may have to wait a while!

@LiveRock
Copy link
Author

Thank you for your fast response.
In the specs, there is mention of a ALERT pin.
So, for 'Touch and Hold', do we need to use Interrupt?

Very much appreciate if you update the library and samples. Many thanks!!

@ChrisBall
Copy link
Owner

Yep, I'd believe you need to use interrupt.

@LiveRock
Copy link
Author

LiveRock commented Jul 1, 2022

Hi Chris

Here is what I am doing but I am not getting the ALERT interrupt:
Here are the config:
Register 0x2A value: 0x00 // CAP1298_MTCONFIG
Register 0x1F value: 0x5F // CAP1298_SENSITIVITY
Register 0x28 value: 0xFE // CAP1298_RPTRATEENABLE
Register 0x26 value: 0xFF // CAP1298_CALIBRATE
Register 0x23 value: 0x0F // CAP1298_SENSINPUTCONFIG2
Register 0x27 value: 0xFF // CAP1298_INTENABLE

Q1: Why am I not getting any interrupt?

Q2: If I receive the interrupt, do I check the status at 0x03 (CAP1298_SENSTATUS) ?

@ChrisBall
Copy link
Owner

Hi LiveRock,

Unfortunately my CAP1298 is no longer responding, so I won't be able to further troubleshoot or adapt the existing code.

With regards to your questions:
Q1: I couldn't say without seeing your setup and code.
Q2: I haven't implemented any touch and hold/interrupt features, and cannot test, so I can only guess from reading the datasheet. Is the INT bit in 0x00 changing state at all?

Chris

@LiveRock
Copy link
Author

LiveRock commented Jul 6, 2022

Thank you Chris. Let me spend a bit of time to figure it out.

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