Switch Bounce?

Help creating logic scripts for Air Manager Instruments

Moderators: Ralph, russ

Message
Author
User avatar
Sling
Posts: 4423
Joined: Mon Sep 11, 2017 2:37 pm
Contact:

Re: Switch Bounce?

#11 Post by Sling » Fri Feb 26, 2021 10:44 pm

The game controller button inputs will have switch debounce of some sort unless there was total neglect on the part of the designer. I have to ask why you are using AM to read the game controller card inputs and not just use it for direct control into the sim. This functionality has only just been implemented in AM so I suppose it could have stability issues. I’ve not really used it other than a quick test when it was first introduced.

fatcharlieuk
Posts: 26
Joined: Tue Dec 22, 2020 7:42 am

Re: Switch Bounce?

#12 Post by fatcharlieuk » Tue Mar 02, 2021 9:59 pm

Just for info, I changed all the joystick inputs oveer to an Arduino Mega and got rid of the game controllers completely. - still got the same problem unfortunately. It doesn't happen with any other aircraft so I'm guessing it's soemthing to do with the aircraft.

I use the game controller because that's what was already built in to my cockpit, it having been developed over several years. The controllers weren't connected to the FS because the panel in my cockpit runs on a second PC and I wanted to keep it all together. also, X-Plane is a bit difficult if you want to attach a switch - many inputs only have an action for the button being pressed.

I was guessing the game controller stff might not be completely stable, being new, hence the move to all-Arduino inputs. To be fair, it does seem less unstable now, but I still get an inastant CTd fairly regularly, triggered by a different input each time.

User avatar
Ralph
Posts: 5070
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Switch Bounce?

#13 Post by Ralph » Wed Mar 03, 2021 4:48 am

If you run the script from the Create/Edit tab and put a print in there, then you can check if there's really any denouncing. You can change the denounce time in your script if necessary.

User avatar
jph
Posts: 641
Joined: Fri Apr 10, 2020 12:50 pm
Location: Portugal

Re: Switch Bounce?

#14 Post by jph » Wed Mar 03, 2021 10:03 am

Hi
Maybe it is just me ;) , but I am totally and utterly confused as to what you are actually doing :?:

What is this 'generic' game controller card you mention ? - what make and model ?.
Are you using it correctly - as in - are you overlapping inputs / outputs for 'buttons' that may be designed as a switch matrix scan / multiplex ?.
These is no issue in X-Plane - for example - if you want a switch, using a game controller, then on a proper matrix, or individual inputs, every time the button inputs or array matrix is scanned then it senses if the switch is selected or not.
Any design that expects a scan / read multiplex button system should have blocking diodes when multiple inputs may be 'pressed' at the same time. Depending on the internal logic a certain maximum simultaneous keypress number can be quoted. In the Bodner, for example, if used in matric mode then the number is a maximum of 3. any matrix cross point in this mode, if used a switch, then each switch that is selected is equivalent to a simultaneous button 'press' Hence you cannot use the bodner array unit - in array mode (32 +4) for switches unless blocking diodes are used.
I presume you are using the Bodner unit in it's '12 input mode' with the switches / buttons from the matrix - column - row pins are used in an individual pin to GND ?. If so, this should cause no issues and doesn't need any blocking diodes. Also, the de-bounce is built in afaik. - in fact, I am certain it is as without it the unit could not be viable. It is way overpriced imho, but certainly does the job very well.
How you are linking this to AM - or attempting to ? I have no idea how or why you would want to try to. Please can you clarify :?: . there should be absolutely no connection at all between AM and a Bodner game controller board, OR, from any 'generic' game controller board. Again, without knowing what this 'generic' game controller actually is and how you are trying to connect all this it is impossible to answer your questions.
The Bodner board is USB HID and has absolutely nothing to do with AM. the 'generic' game controller should also be HID and also have absolutely nothing to do with AM. Each is a completely individual entity that works in a fully standalone mode. At no time should the systems be considered anything other than stand alone.
Joe.
“Everything in moderation, including moderation.”
“Experience is merely the name men gave to their mistakes.”
Joe (CISSP) -IT security consultant

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests