Hi everybody,
I just installed an old PC that has a sound card(isa with sound card+joystick interface) that i use as an automation device(programmed in Pascal). What it does is read for many hours the joystick port for buttons pressed(a digital sensor connected to a relay closes the circuit and generates the event). The problem is that is generating erratic button presses( with absolutely no aparent reason - it works for days with no problem then it fails) - it might be the sensor who sends the wrong signal..electric noise...but i believe the problem is on the side of the computer. What should i do - might it be a defective sound blaster compatible card?
The sensor is trying to sense a metal(the metal is glued to a 35mm cinema film)..when it senses the metal(very rapidly..in a fraction of a second) it activates a "relay" that closes the circuit for the joystick button generating an event.
The code i use to read the bit In pascal:
FUNCTION button_1 : Byte; BEGIN button_1 := ((Port[$201] AND $10) XOr $10) ShR 4; END;
Isn't there a way to force the event to last longer than the time the relay is active to allow me to diferentiate between real events and hipothetical electricity contamination?
Some sort of a timer..everything happens very quickly...
Any help would be welcome. Thank You.