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:
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:
But for “send a key only when the door opens,” keep tOff: 0.
Edited by fhjui, Today, 07:27 AM.