You are here

Different application with Capsense button | Cypress Semiconductor

Different application with Capsense button

Summary: 2 Replies, Latest post by Goose on 28 Aug 2013 08:21 AM PDT
Verified Answers: 0
Last post
Log in to post new comments.
user_253382995's picture
28 posts


I want to get information for an application.I pushed capsense button, for example works motor. If I press the even longer same button works another motor. For example counter. When I pressed button for once, increase counter once, ı hold down same capsense button counter increase in tens. How should I do this with program. Thanks.

user_14586677's picture
7646 posts


Basically you implement a time counter or a clock connected to an ISR. To

differentiate how long you hold a button down, and based on time held

implement different functions, like starting the alternate motor.


So create a timer, say 100 mS, enable its interrupt, and each time ISR

fires inc a time counter. Then in main() test the counter and based on its

value action different tasks. When released you clear the time counter.


Regards, Dana.




user_276170980's picture
57 posts

For controlling motors :--


You can use a timer for this.


As a button press is detected, start the timer . And as the button is released, stop the timer.

Read the timer value.

If it is more than a threshold value [selected by you, say 2 seconds] then motor2 is started. Else motor1 is started.



Log in to post new comments.