On and Off with the same bang

It is your faforite problemm maker again…

This is puzzeling me all night, I want to set a value to 1 with a bang and hold it for 5 seconds, after that it should go to 0 again.

If I press the bang again, within those 5 seconds the value should go to 0 also.

I got this to work, but if I want to restart it, I have to press the BANG 2 times.

This ‘puzzle’ already costed me 4 hours, and I just lost my sight off logic, so I realy hope one off the genuises here can help me out.

Thnx again, and greetings from the Netherlands!!

WestbamPuzzle.v4p (5.4 kB)

you have to insert a TogEdge (Animation) before your toggle node
for “debouncing” the IO-bang-box

otherwise sometimes it are 2 or more very fast clicks (to fast to recognize!)

MonoFlop (Animation) could also come handy here.

Thnx for the reply people.

With TogEgde the problemm remains, (dubble click after I wait just for 5 Sec), and I already have a monoflop in there.

Problemm is that I have to reset the toggle either by clicking om BANG witin 5 sec, or waiting until the 5 sec are past.

Any one?

what about this?

toggle_5sec.v4p (3.1 kB)

:)

Thanks!! I also tried to use something with the frame delay for feedback, I think this works!!

(I realy spend more than 6 hours on this one, I think I will have to read up on coding logic for newbies)

1 * 1 = 1
0 * 1 = 0
0 * 0 = 0

DOH!!