Suitable switch to use as remote control

FYP Starter Pack, ICs, Voltage Regulator, Resistor, Capacitor......

Suitable switch to use as remote control

Postby Lovetronic » Sat Mar 08, 2014 11:39 pm

Someone can advice me what switch is suitable to use in my remote control. I had tried push button however it does not compatible with the coding (I'm using chipkit UNO32). My intention is to make the user select AUTO mode or MANUAL Mode. After selecting, the user will ask to select speed and duration. So this requires a lot of loop-inside-a-loop, if-inside-if etc. When I'm using push button, the microcontroller cannot read the command when the second button is push.
Lovetronic
Greenhorn
 
Posts: 2
Joined: Sat Mar 08, 2014 11:22 pm

Re: Suitable switch to use as remote control

Postby sich » Mon Mar 10, 2014 9:13 am

I don't really understand your problem. What kind of remote control are you referring to? Actually push button is commonly used in remote control. Not sure why you said it's not suitable. Those loops and if-else conditions are to be done in programming.
~> How to ask QUESTIONS the SMART way in FORUM? <~
User avatar
sich
Moderator
 
Posts: 603
Joined: Tue Apr 21, 2009 2:15 pm

Re: Suitable switch to use as remote control

Postby yonghui » Mon Mar 10, 2014 9:57 am

try put a 0.1Uf ceramic or multilayer capacitor across the push button switch
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: Suitable switch to use as remote control

Postby wilson » Thu Mar 20, 2014 11:07 pm

Lovetronic WROTE:Someone can advice me what switch is suitable to use in my remote control. I had tried push button however it does not compatible with the coding (I'm using chipkit UNO32). My intention is to make the user select AUTO mode or MANUAL Mode. After selecting, the user will ask to select speed and duration. So this requires a lot of loop-inside-a-loop, if-inside-if etc. When I'm using push button, the microcontroller cannot read the command when the second button is push.



Hi,

This is not the hardware problem, is your program flow. If i not understand wrong, what you want is something like can select a menus, after select the menu, inside have speed and duration. to make you programming easy, you need to write a code that detect push button with interrupt, normally PIC32 PORTB has On-change interrupt, so every time user press button, it will goes to On-change interrupt. in interrupt, you can activate a timer(PIC32 a lot of timer ) to de-bounce the push button.

Once confirm button is push by read the input, increase your menu position counter. if 1 mean go to menu 1, if 2 go to menu 2. Once counter more then two, roll it back to 0, why ? because you only have 2 menus. After you know the menu position, you need another counter for sub-menu, just follow the same way.

If you are using polling method to read push button, it is very hard to make sure it will not miss the pressing count.

hope this help.
wilson
Novice
 
Posts: 19
Joined: Thu Mar 13, 2014 10:36 pm


Return to Electronic Component

Who is online

Users browsing this forum: No registered users and 11 guests

cron