Page 1 of 1

Suitable switch to use as remote control

PostPosted: Sat Mar 08, 2014 11:39 pm
by Lovetronic
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.

Re: Suitable switch to use as remote control

PostPosted: Mon Mar 10, 2014 9:13 am
by sich
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.

Re: Suitable switch to use as remote control

PostPosted: Mon Mar 10, 2014 9:57 am
by yonghui
try put a 0.1Uf ceramic or multilayer capacitor across the push button switch

Re: Suitable switch to use as remote control

PostPosted: Thu Mar 20, 2014 11:07 pm
by wilson
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.