The NEW Build Your Own Arcade Controls

Main => Main Forum => Topic started by: DominatorxR on January 02, 2018, 10:45:20 am

Title: Zero delay pcb button cut off
Post by: DominatorxR on January 02, 2018, 10:45:20 am
Hi,

I am trying to make the board cut off input after pressing a button.
What i want to do is connect a 2 way toggle switch to the same butten.
So when i switch it up it activates button 1 and after like .2 seconds it should deactivate.
When i switch it down it activates button 1 again and again deactivates after.2 seconds.

Is there a way to alter the pcb to do this standard?
Also is it possible to make the pcb standard in the second mode? (pov instead of joystick?)
And while i'm at it. is it also possible to deactivate the pov after .2 seconds?
The timing of .2 seconds is not fixed, may be shorter or longer if that is easier.

Edit: Also forgot to mention, it's for an Windows pc, so any software to do this is welcome too :)

Thanks in advance!
Gordon
Title: Re: Zero delay pcb button cut off
Post by: Titchgamer on January 02, 2018, 04:55:49 pm
The only way I think you would be able to do something like that would likely cause you issues in other areas due to it being a software mod.

Why do you want a toggle switch as a momentary switch anyway?
Title: Re: Zero delay pcb button cut off
Post by: PL1 on January 02, 2018, 05:20:18 pm
I am trying to make the board cut off input after pressing a button.
What i want to do is connect a 2 way toggle switch to the same butten.
So when i switch it up it activates button 1 and after like .2 seconds it should deactivate.
When i switch it down it activates button 1 again and again deactivates after.2 seconds.

Is there a way to alter the pcb to do this standard?
Also is it possible to make the pcb standard in the second mode? (pov instead of joystick?)
And while i'm at it. is it also possible to deactivate the pov after .2 seconds?
The timing of .2 seconds is not fixed, may be shorter or longer if that is easier.

Edit: Also forgot to mention, it's for an Windows pc, so any software to do this is welcome too :)
Not sure what you plan to use this for since .2 seconds is way too short to rotate a monitor and probably too short to servo-switch a 4-/8-way joystick.   :dunno

Based on your somewhat limited description, here are several options that come to mind:

  1.  Use a momentary toggle/rocker switch.  (on) off (on) or off (on)

  2.  Use timed relays -- triggering the relay holds the contacts closed for a certain amount of time.

If these options aren't what you're looking for, please post a more detailed description of what you want to do.


Scott
Title: Re: Zero delay pcb button cut off
Post by: DominatorxR on January 02, 2018, 05:21:15 pm
Well i'm working on a flight sim control unit.
So what i try to do is to make it that i can use as many functions on that board as possible.

You can set the controls as for example:
switch up raises the landing gear as an control and switchdown lowers the langing gear as an control.
This means that i need 2 button on the pcb for that.
It's also possible to us the toggle landing gear control.
So if you press button 1 than it lowers the gear, if you press it again it raises the landing gear.
The problem with that is that the moment that the switch "releases" the button is too short for the pcb to reconize it.
If it cuts off after a short while than i hope flicking the switch will send a new signal.

I realise this is a arcade forum, but since this is an arcade pcb i assume you guys know a lot more about it than others :)
Hope i make sense.
Title: Re: Zero delay pcb button cut off
Post by: PL1 on January 02, 2018, 05:34:42 pm
For a flight sim landing gear retract/extend with a single input port, a momentary toggle/rocker switch would be the easiest option.   ;D


Scott
Title: Re: Zero delay pcb button cut off
Post by: Titchgamer on January 02, 2018, 05:52:22 pm
For a flight sim landing gear retract/extend with a single input port, a momentary toggle/rocker switch would be the easiest option.   ;D


Scott

What Scott says.

You are seriously over complicating that lol
Title: Re: Zero delay pcb button cut off
Post by: DominatorxR on January 02, 2018, 05:53:33 pm
Yeah i realise this, but i allready have 25 pieces of these switches so i'd really like to makes this work  ;D
Title: Re: Zero delay pcb button cut off
Post by: PL1 on January 02, 2018, 06:11:15 pm
Yeah i realise this, but i allready have 25 pieces of these switches so i'd really like to makes this work  ;D
Even if it's more expensive and far more complicated than a momentary switch?   >:D


Scott
Title: Re: Zero delay pcb button cut off
Post by: DominatorxR on January 02, 2018, 06:24:31 pm
Isn't it possible to just make the turbo mode cut off at 1 cycle?
Title: Re: Zero delay pcb button cut off
Post by: PL1 on January 02, 2018, 06:59:21 pm
Isn't it possible to just make the turbo mode cut off at 1 cycle?
Odds are extremely high that it's not possible with the simple, non-programmable gamepad firmware used in the ZD.

There may be an undocumented feature that allows it, but it seems like someone around here would have found and mentioned it by now.   :dunno


Scott
Title: Re: Zero delay pcb button cut off
Post by: loupg on January 03, 2018, 02:41:32 pm
OK, here's my insane idea to solve your issue.

Use an arduino to control the landing gear switches.  What's kind of neat is that you could also use a toggle switch for this if you wanted as well.

Easiest way, have something like pin 2 be your input and pin 13 be your output

Code: [Select]
const int inputPin = 2;     // the number of the pushbutton pin
const int outputPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the output pin as an output:
  pinMode(outputPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(inputPin, INPUT);
}

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(inputPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(outputPin, HIGH);
    delay(200);
    digitalWrite(outputPin, LOW);
  }
}

(note, this code is assuming you're using a pulldown resistor, ideally you'd use a pullup resistor instead as the arduino is ttl.)

If you want it to control two different inputs on the PCB, just define a second output on the arduino, and set a variable that changes every time the button is pressed so it knows which output to send the signal to.

If you want to use a toggle switch, then have it keep track of the current input, and check for state changes every time it goes through the loop, so it knows if the switch has been flipped and can send the appropriate output.

There are a few different ways to send the appropriate signal to the PCB, you could use a relay, but they're loud (they make an audible click), you could use a transistor, but then you're tying the your two circuits together electrically, which I don't like, or my new personal favorite, you could use an optocoupler, which keeps the circuits electrically separate, but allows them to interact with each other.

I'd also recommend adding a debounce to the program to make sure it's not getting faulty input, which is basically just checking the input, waiting a few ms and checking again to make sure the input hasn't changed.

That being said, my idea is silly (but would work) and requires some knowledge of electronics and programming.
Title: Re: Zero delay pcb button cut off
Post by: DominatorxR on January 06, 2018, 02:53:41 pm
Hi all,

Thanks for all the help!
I got it all working thanks to the suggestion of Loupg.
Using UCR i programmed it so that on release of the button (or toggle off) it gives an other signal.
This way it works perfectly in DCS!
Thanks again!

Gordon