if pin1 =0 then do_it

Gildardo

Member
Hi there,
I’m using the “if pin1 =0 then do_it” function to make a pin high when I press a push button. Nevertheless I’ve found that if I press the push button too fast the pin doesn’t go high. Should I add a multivibrator/one shot to make the low state last?
Thank in advance for your help
 

BCJKiwi

Senior Member
Looks like a case of either;
1. the program is still doing other things and has not got around to monitoring the switch yet,
or,
2. some form of 'switch bounce'.

Review the program to see if it is likely to be 1. or 2.

If 1. you may need to resort to using interrupts - see manual1 page 64
If 2. check out the topic in Manual3 page26
 

premelec

Senior Member
Putting a capacitor and resistor in parallel to V+ or - depending on your button operation can help stretch the input pulse a bit. Also don't make it so the input pin floats when the button is NOT pressed...
 

Andrew Cowan

Senior Member
Make sure you havent got any pauses anywhere. I have had a few times when that happens, but then I realise there is a pause 30 or something in the loop.
 
Top