- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
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.
- Labels:
-
PSoC 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
Regards.