PSOC400 Button Capsense issue?

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

cross mob
David_Zhang
Level 5
Level 5
Distributor - Arrow(GC)
First comment on blog First like received 50 sign-ins

  i design a pcb of touch button,  how do i know the button was touched,  and if i want long touch key and short touch key , what should i do ?

0 Likes
1 Solution
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi David,

If you are using CapSense_CSD v2.x, you can use CapSense_sensorOnMask[], This is a uint8 array that holds the sensor 'on' or 'off' state (for buttons, matrix buttons or sliders). CapSense_sensorOnMask[0] contains the masked bits for sensor 0 through 7 (sensor 0 is bit 0, sensor1 is bit 1). CapSense_sensorOnMask[1] contains the masked bits for sensor 8 through 15 (if they are needed), and so on. This uint8 array contains as many elements as are necessary to contain all placed sensor. The value of a bit is 1 if the sensor is on and 0 if the sensor is off.

If you are using CapSense_CSD v3.x/4.x/5.x, you can use the struct instance: CapSense_dsRam.snsStatus[wdgtId]. Its prototype is defined in CapSense_RAM_STRUCT in CapSense_Structure.h.

Either long touch or short touch, requires customized code to identify it.

Thanks,

Ryan

View solution in original post

0 Likes
1 Reply
RyanZhao
Moderator
Moderator
Moderator
250 sign-ins First question asked 750 replies posted

Hi David,

If you are using CapSense_CSD v2.x, you can use CapSense_sensorOnMask[], This is a uint8 array that holds the sensor 'on' or 'off' state (for buttons, matrix buttons or sliders). CapSense_sensorOnMask[0] contains the masked bits for sensor 0 through 7 (sensor 0 is bit 0, sensor1 is bit 1). CapSense_sensorOnMask[1] contains the masked bits for sensor 8 through 15 (if they are needed), and so on. This uint8 array contains as many elements as are necessary to contain all placed sensor. The value of a bit is 1 if the sensor is on and 0 if the sensor is off.

If you are using CapSense_CSD v3.x/4.x/5.x, you can use the struct instance: CapSense_dsRam.snsStatus[wdgtId]. Its prototype is defined in CapSense_RAM_STRUCT in CapSense_Structure.h.

Either long touch or short touch, requires customized code to identify it.

Thanks,

Ryan

0 Likes