Go Down

Topic: Make continuous switch momentary? (Read 793 times) previous topic - next topic

jvdb

Is there an easy way to do this? I can find a lot of examples for latch circuit (basically the opposite of what I want).

AWOL

#1
Oct 24, 2011, 06:26 pm Last Edit: Oct 24, 2011, 07:00 pm by AWOL Reason: 1
Sure, just look for changes, either low to high, or high to low.
i.e. is the state of the switch different to last time you looked?
(or did you mean mechanically?)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

xl97

this is also something I have been curious about. :)

I am curious not mechanically ,but from a code standpoint..

In my mind..  code wise.. does it matter the switch type?

Maybe Im over/under thinking it as I have never tried..




jvdb


Sure, just look for changes, either low to high, or high to low.
i.e. is the state of the switch different to last time you looked/
(or did you mean mechanically?)


This would be easy with an arduino, but my friend's project does not use one. I am helping her build one of these:

http://volpinprops.blogspot.com/2010/11/portal-gun-for-childs-play_22.html

Using this sound board:

http://www.replicaprops.com/Sound-board-for-props-and-costumes-model-4M_p_64.html

My problem is that the on/off switch is DPDT (turns LEDs on and off), but should also trigger momentary pulse to the pins on sound chip for on and off sounds. It works with continuos current to pin (doesn't repeat sound or anything), but a momentary switch is  spec'd.

AWOL

Quote
This would be easy with an arduino,

Well, yes, this is an Arduino forum.

What about using a 555?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

jvdb

I realize that, but I thought it would be OK to ask in General Electronics section.

xl97



for OP:  (maybe this)

http://www.pololu.com/catalog/product/750


anyways...
Im still interested in have a conversation/enlightenment on the Arduino way to handle switches in code?

Anyone have a quick code/sketch sample to look at for using/detecting a latching/vs momentary switch?

thanks


Go Up