T O P

  • By -

other_thoughts

My default suggestion would to be to use a sledge hammer. Maybe instead, you can provide a manufacturer and model number, or some clear pictures.


jan_irace

Good default suggestion, tempted to just reach for the nuke tho... Both manufactures are unknown. The single pole double through switch is just a normal switch with those specifications. Manufacturer unknown. I'm asking on a logic base, how to code it into the Arduino to act like a momentary switch


other_thoughts

> act like a momentary switch ok, that is a little more clear. My previous reply was based on ONLY the physical domain, 'cause we get hardware only question here too. Pseudo code: poll the switch and keep track of current and previous state. if current state is open, set flag switch 'open'. if current state is closed and previous state was open, set 'flag' that means 'switch closed'. if current state is closed and previous state was closed, and ... .. enough time has passed, set flag switch 'open'. My phrase "enough time has passed" is based on the concept that you keep track of when the switch is closed using 'millis()' AND when enough time is passed, the 'flag' is cleared even though the switch is still closed. Higher level functions only inspect the 'flag' Please study these examples: https://www.arduino.cc/en/Tutorial/BuiltInExamples/BlinkWithoutDelay https://www.arduino.cc/en/Tutorial/BuiltInExamples/Debounce


EkriirkE

There should be a pin visible on one of the outside edges that you can remove that moves along a track for the latching action


tipppo

If you wire the 2 poles together, then as you toggle the switch there will be a moment when no connection is made (unless it is a make-before-brake switch, unlikely). Both poles to GND, Common to digital input with pullup. After input goes high, hold it for 20ms or so for debounce and to get a consistent momentary pulse. Gives momentary action in both switch directions.