JoeFromOzarks
Senior Member
Howdy folks! I’m looking for a method of detecting/eliminating short duration inputs, something like contact bounce, four inputs simultaneously.
When a PICAXE input changes state for less than, say, 100ms, 250ms or so, then the transition is considered invalid and is ignored. If the input changes state for more than, say 100ms, 250ms or so, then the transition is considered valid and the PICAXE acts on it, turning on an output.
(In this case, a PICAXE input HIGH means the input circuit is normally open or OFF, a PICAXE input LOW means ON. The input signal is inverted.)
The actual circuit looks something like this:
--14M2 with 4 digital inputs and 3 digital outputs. (When any of the inputs go LOW (turned ”on”) then the three outputs go HIGH - while any of the inputs are LOW.)
--Any one (or more) of the four inputs can be turned “on” (sent LOW) in no specific order.
--Under normal circumstances, an input is transitioned for duration's of about quarter-second (100-250ms) or GREATER is considered valid.
--Standard 5VDC circuit, stable power supply.
My PICAXE coding inexperience is massive. <grin> I don’t have any code to share but I’ve considered DO…LOOPs, but that locks in one input at the expense of ignoring the other three. I eyeballed interrupts but maybe I should’ve dedicated more time to using the 18M2. And then there is that “time elapsed” thing, using a 14M2 or 18M2 determining if the elapsed time is greater than 100ms or 150ms, or so.
Forum friends, what would you suggest? (The attachment is for giggles only and has nothing to do with this project!)
Thank you!!
joe
When a PICAXE input changes state for less than, say, 100ms, 250ms or so, then the transition is considered invalid and is ignored. If the input changes state for more than, say 100ms, 250ms or so, then the transition is considered valid and the PICAXE acts on it, turning on an output.
(In this case, a PICAXE input HIGH means the input circuit is normally open or OFF, a PICAXE input LOW means ON. The input signal is inverted.)
The actual circuit looks something like this:
--14M2 with 4 digital inputs and 3 digital outputs. (When any of the inputs go LOW (turned ”on”) then the three outputs go HIGH - while any of the inputs are LOW.)
--Any one (or more) of the four inputs can be turned “on” (sent LOW) in no specific order.
--Under normal circumstances, an input is transitioned for duration's of about quarter-second (100-250ms) or GREATER is considered valid.
--Standard 5VDC circuit, stable power supply.
My PICAXE coding inexperience is massive. <grin> I don’t have any code to share but I’ve considered DO…LOOPs, but that locks in one input at the expense of ignoring the other three. I eyeballed interrupts but maybe I should’ve dedicated more time to using the 18M2. And then there is that “time elapsed” thing, using a 14M2 or 18M2 determining if the elapsed time is greater than 100ms or 150ms, or so.
Forum friends, what would you suggest? (The attachment is for giggles only and has nothing to do with this project!)
Thank you!!
joe
Attachments
-
132.6 KB Views: 18