I have a question. I had salvaged this neat little micro switch that came out of a
webcam. I have placed that inside the casing underneath the casing's button, so
that I can press this button and have it run somekind of script.
The problem is that now that the switch is in and hooked up to an ADC port, I find
out that this switch is normally closed and breaks the circuit when pressed in. I have the groundwire of the switch hooked up on ground, and the (+) wire is hooked
to the signal. So when pressed, it breaks the circuit and the value of the adc port will read 0. if i want it to trigger a script when pressed in, it would have to trigger
that script when the value of the ADC port reads 0.
But as the ADC port is reading itself, it sends out signals ranging from 0 - full and anywhere in between. Which means that it will frequently bump into the 0 value regardless of wether i press this switch or not. And so the script will keep on triggering over and over by itself..
The only solution i can think of is to put in somekind of delay. That it will trigger only
when it reads the value 0 for longer then a second. But I have a hard time putting this in code, maybe I'm missing something or maybe I lack the insight to come up
with logical routines to make this happen. If someone has an idea, I would very much