虚拟按键

公告

大中华汽车电子生态圈社区并入开发者社区- 更多资讯点击此

Tip / 登入 to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
GrWa_2302706
Level 4
Level 4
50 questions asked 25 replies posted 10 replies posted

Hi

我用CapSense CSD组件想做一个虚拟按键,我的CapSense组件配置是增加一个button (引脚分配给实际的触摸按键pin)以及一个proximity sensor (就是想设置的虚拟按键),proximity sensor的number of dedicated sensor为0,proximity sensor的scan order是第一位同时sensor选为button0。但是我发现没有这个proximity sensor时,实际按键可以正常触发,但是加上这个proximity sensor后,实际按键就没作用。主要是通过点灯动作来验证。

想问一下,这种增加虚拟按键的方式是不是错误的?

Thanks and regards.

Grace

0 点赞
1 解答
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Hi Grace,

下面的回答基于你用的是CSD 2.6 版本。

造成你这个问题的原因有两个:

1: 接近感应的sensor默认是没有使能的,所以如果你的系统里面有接近感应sensor的话,你需要手动使能,这一点你可以查看组件datasheet, proximity sensor 一章节。

Note All widgets are enabled by default except proximity widgets. Proximity widgets must be

manually enabled in API as their long scan time is incompatible with the fast response required

of other widget types. Use the CapSense_EnableWidget() function to enable proximity widgets.

See How to use the proximity sensors for more information about proximity sensors.

2: 你系统关于接近感应的参数调试的有一些问题。

3: 新的工程,我在042的板子上面测试过了,可以正常使用。

4: 工程在附件,请下载进行测试。

在原帖中查看解决方案

0 点赞
3 回复数
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Hi Grace,

从你描述的这些逻辑里面,我没发现有什么问题。

你可以把测试代码发给我看一下。

Thanks,

Lingling

0 点赞

Hi Lingling

我没有找到上传附件的方式,麻烦你从如下网盘链接下载工程:

链接:https://pan.baidu.com/s/1IWSc0sR01FBXC2YF9pfcjA

提取码:waa6

我用的是CY8CKIT-042 kit测试。感谢。

BR

Grace

0 点赞
lock attach
Attachments are accessible only for community members.
LinglingG_46
Moderator
Moderator
Moderator
500 solutions authored 1000 replies posted 10 questions asked

Hi Grace,

下面的回答基于你用的是CSD 2.6 版本。

造成你这个问题的原因有两个:

1: 接近感应的sensor默认是没有使能的,所以如果你的系统里面有接近感应sensor的话,你需要手动使能,这一点你可以查看组件datasheet, proximity sensor 一章节。

Note All widgets are enabled by default except proximity widgets. Proximity widgets must be

manually enabled in API as their long scan time is incompatible with the fast response required

of other widget types. Use the CapSense_EnableWidget() function to enable proximity widgets.

See How to use the proximity sensors for more information about proximity sensors.

2: 你系统关于接近感应的参数调试的有一些问题。

3: 新的工程,我在042的板子上面测试过了,可以正常使用。

4: 工程在附件,请下载进行测试。

0 点赞