Page 1 of 1
Simple circuit, but it does not work
Posted: Thursday 23 February 2023 22:11
by Johan1974
I'm trying to make a simple circuit in Dzvents, but it's going to be a pinball machine.
If IDX1 turns on or off, IDX2 must also turn on or off.
and
If IDX2 turns on or off, IDX1 must also turn on or off
When I make this in DZvents, IDX1 and IDX2 start flashing
Can someone help me?
Re: Simple circuit, but it does not work
Posted: Friday 24 February 2023 9:48
by BartSr
Hi!
Maybe better to post your code here. Then it's easier to help.
Re: Simple circuit, but it does not work
Posted: Friday 24 February 2023 11:20
by willemd
To me it is not clear what you are trying to achieve. Better describe it with one state-change at a time.
If IDX1 turns on, then also IDX2 must turn on.
If IDX2 turns on, then also IDX1 must turn on.
So in the end when IDX1 turns on then both turn on and stay on?
or
If IDX1 turns on, then also IDX2 must turn on.
If IDX2 turns on, then IDX1 must turn off?
If IDX1 turns off, then also IDX2 must turn off?
If IDX2 turns off, then IDX1 must turn on?
This might be the flashing that you get now.
Re: Simple circuit, but it does not work
Posted: Friday 24 February 2023 14:31
by heggink
Your code runs the risk of leading to a flip flop. You can prevent that by adding .silent() such that the script will not call itself.
Re: Simple circuit, but it does not work
Posted: Friday 24 February 2023 14:42
by waltervl
Perhaps a .checkFirst() command option will also prevent a loop?