Jump to content



Photo
- - - - -

Pinscape Pico NC switch for button


  • Please log in to reply
2 replies to this topic

#1 DDH69

DDH69

    Pinball Wizard

  • Platinum Supporter
  • 3,605 posts
  • Location:DOFLinx HQ, Adelaide

  • Flag: Australia

  • Favorite Pinball: Monster Bash

Posted Today, 03:11 AM

I'm trying to figure out if there is configuration that will cope with my situation or do I need to apply a hardware solution.

 

I have a Pinscape Pico setup with 3 x 74hc165 chips daisy chained for 24 inputs that trigger when pulled to ground.  I have one switch for my coin door open that is normally closed when the door is shut (it uses an alarm tamper switch, so NC).  I really only want a keyboard key press when the door opens, so when the button is not pressed.  It is the only one of 24 switches that is NC, the rest are normally open.  I was wondering if there is a way to configure the PS Pico button configuration, possibly its "type".  The default is "push", I almost need a "pull". Would "toggle" possibly work only signalling VP when the coin door switch state changes?

 

Any thoughts most welcome.


DOFLinx
Contributions for equipment to help with ongoing DOFLinx development can be made here

#2 fhjui

fhjui

    Enthusiast

  • Members
  • PipPipPip
  • 370 posts
  • Location:Germany

  • Flag: Germany

  • Favorite Pinball: especially EM tables

Posted Today, 07:25 AM

I suggest to ask chatgpt in such a case. yes, it should work with software. Finds the solution in 51 sec. I use KI more and more for programming solutions, instead of spending hours to read datasheets, manuals..its amazing. 

I had copy/paste your question. For once, I’m posting AI answers here, since not everyone has a Pro account.

I hope it works..

 

Yes — this should be solvable in Pinscape Pico configuration, no hardware inverter needed.

For your NC coin-door switch:

Door state NC tamper switch 74HC165 input What you want Door shut closed to GND LOW no key Door open open / pulled up HIGH key press

Pinscape Pico has exactly the needed inversion at the button source level: source.active.

The docs say physical inputs can be "active": "high" or "active": "low", with active-low being the default for normal switch-to-ground wiring.

The 74HC165 section also confirms the standard wiring: pull-up to 3.3 V, switch to GND, so the input reads LOW when pressed and HIGH otherwise.

So for that one input, set:

 
 
{
name: "Coin Door Open",
type: "pulse",
source: {
type: "74hc165",
chip: 2,
port: "A",
active: "high"
},
action: {
type: "key",
key: "end"
},
tOn: 100,
tOff: 0
}
 

Adjust chip, port, and key to your real setup.

The important parts are:

 
 
active: "high"
 

This makes the logical button become “pressed” when the 74HC165 input is HIGH, which is your door open state.

And:

 
 
type: "pulse",
tOn: 100,
tOff: 0
 

This sends a short key press when the door opens, but nothing when it closes. Pinscape’s docs specifically describe pulse as useful for on/off switches where the Windows-side program expects a key press on a state change, and even mention the coin-door switch as the canonical example.

I would not use toggle for this. toggle flips the output state every time the underlying physical button is pressed, and stays latched until the next press.

That is useful when you want a momentary switch to behave like an on/off switch, but it is the wrong direction for your case.

So the likely best setup is:

 
 
type: "pulse"
source.active: "high"
tOn: 100
tOff: 0
 

If VP/VPX actually expects the same coin-door key once on open and once on close to toggle its internal state, then use:

 
 
tOn: 100,
tOff: 100
 

But for “send a key only when the door opens,” keep tOff: 0.


 

Edited by fhjui, Today, 07:27 AM.

My documentation for installing vpin software with PinUpsystem (Baller installer): https://mega.nz/fold...wAXZlOEMQGbdutQ

Files and PDF-docu in the subdir "Installation vPin-Software with Baller-Installer"


#3 Suikazz

Suikazz

    Enthusiast

  • Members
  • PipPipPip
  • 133 posts

  • Flag: Hungary

  • Favorite Pinball: GoT

Posted Today, 09:31 AM

        {
            type: "pulse",
    source: { type: "74hc165", chip: 1, port: "E", debounceTimeOff: 10000, debounceTimeOn: 10000, lowPassFilterRiseTime: 50, lowPassFilterFallTime: 50 },// Button header input pin #13
            action: { type: "key", key: "end", },
        },


this is all code you need, just make sure you have the correct chip and port assigned
"pulse" doesn't care if the normal state is "high" or "low", it only looks for change of state
 
 
EDIT:
btw, NC means that the switch is held closed during its normal state of operation. the internal of the switch is designed that way that in NC, the switch is OPEN, no contact!!!
Check it with your multimeter ;) If, for any reason, the contact reads CLOSED, you then could try  active:"high" in a second step

Edited by Suikazz, Today, 09:47 AM.