Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Zero delay pcb button cut off  (Read 2115 times)

0 Members and 1 Guest are viewing this topic.

DominatorxR

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 12, 2018, 04:32:28 am
  • I want to build my own arcade controls!
Zero delay pcb button cut off
« 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
« Last Edit: January 02, 2018, 02:17:06 pm by DominatorxR »

Titchgamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4222
  • Last login:December 17, 2023, 08:05:48 am
  • I have a gaming addiction.....
Re: Zero delay pcb button cut off
« Reply #1 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?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 08:28:08 pm
  • Designated spam hunter
Re: Zero delay pcb button cut off
« Reply #2 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

DominatorxR

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 12, 2018, 04:32:28 am
  • I want to build my own arcade controls!
Re: Zero delay pcb button cut off
« Reply #3 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.
« Last Edit: January 02, 2018, 05:23:21 pm by DominatorxR »

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 08:28:08 pm
  • Designated spam hunter
Re: Zero delay pcb button cut off
« Reply #4 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

Titchgamer

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4222
  • Last login:December 17, 2023, 08:05:48 am
  • I have a gaming addiction.....
Re: Zero delay pcb button cut off
« Reply #5 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

DominatorxR

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 12, 2018, 04:32:28 am
  • I want to build my own arcade controls!
Re: Zero delay pcb button cut off
« Reply #6 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

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 08:28:08 pm
  • Designated spam hunter
Re: Zero delay pcb button cut off
« Reply #7 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

DominatorxR

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 12, 2018, 04:32:28 am
  • I want to build my own arcade controls!
Re: Zero delay pcb button cut off
« Reply #8 on: January 02, 2018, 06:24:31 pm »
Isn't it possible to just make the turbo mode cut off at 1 cycle?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9394
  • Last login:Yesterday at 08:28:08 pm
  • Designated spam hunter
Re: Zero delay pcb button cut off
« Reply #9 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

loupg

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 51
  • Last login:December 26, 2021, 06:20:34 pm
Re: Zero delay pcb button cut off
« Reply #10 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.

DominatorxR

  • Trade Count: (0)
  • Jr. Member
  • **
  • Offline Offline
  • Posts: 5
  • Last login:January 12, 2018, 04:32:28 am
  • I want to build my own arcade controls!
Re: Zero delay pcb button cut off
« Reply #11 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