Erratic behaviour joystick button on soundblaster.

This is a discussion on Erratic behaviour joystick button on soundblaster. within the Pascal forums in Programming Languages category; 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 contamination...but i believe the problem is on the side of the ...

Go Back   Application Development Forum > Programming Languages > Pascal

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-21-2008, 02:25 PM
cyberfreak
Guest
 
Default Erratic behaviour joystick button on soundblaster.

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
contamination...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...


Thank You.




An help would be welcome.


Reply With Quote
  #2  
Old 08-21-2008, 05:39 PM
Jim Leonard
Guest
 
Default Re: Erratic behaviour joystick button on soundblaster.

On Aug 21, 1:25 pm, cyberfreak <AFSem...@gmail.com> wrote:
> The problem is that is generating erratic button presses( with
> absolutely no aparent
> reason - it works for days with no problem then it fails)


That could be anything, but it's not your code and I highly doubt it's
the sound blaster. It's either the PC getting hot and erratic, or
some operating system issue after being up for four days.

> 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?


Sure, using a loop while looking at the 8253/4 timer to figure out how
long things are taking. Look up PCTIM003.TXT for everything you ever
wanted to know about using the timer.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:21 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.