Hello everyone!
The circuit system confuses me greatly, so while i have managed to understand how existing examples (like timers and latches) work, i have trouble figuring how to make the following setup:
One boolean input
If input is 0, output is 0
If input is 1, set output to 1 after 10 seconds.
If input goes to 0 at any point, set output to 0 and reset timer back to 10 seconds.
Any advice? I've tried playing around with the timer design offered in the tutorial section but cant find a way to make it work with an external trigger that can set and reset it.
DaveMcW wrote: Sat Dec 28, 2019 5:59 pm
A blueprint with "each" signal
This is fucking sorcery. No surprise i couldnt figure this on my own considering i didnt know how exactly this stupid yellow asterisk works.
Also, i wonder - is this the best approach to "smooth" an input that might oscillate?
Basically, i have my defenses (along with a lot of solar panels and batteries) on a separate power grid. Normally it is linked to the production grid so that excess power flows there. However, if there is some problem in the factory and its losing power real hard (so that it would drain battery charge from defense grid) the defense grid shuts off. If its daytime, the defense grid then instantly recovers to 100% and the power link ends up oscillating.
That's what i've been trying to prevent with this circuit set up.
Re: Need help making delayed output circuit
Posted: Sat Dec 28, 2019 10:33 pm
by DaveMcW
Accumulators fill at a rate of 6% per second, so you could use the RS latch example with a couple different accumulator levels.
Re: Need help making delayed output circuit
Posted: Sun Dec 29, 2019 12:06 am
by TruePikachu
For people who don't want to import the blueprint above, the settings are as follows (where → represents value assignment and ⇒ represents decider true/false assignment):
Green-wire constant is 1→✓
Red-wire constant is 1→A 1→B
Arithmetic is EACH*✓→EACH
Left decider is A>0→B (note there's a looparound wire as well)
Right decider is B>600⇒✓
The arithmetic combinator is used to enable/disable "hold" and "count" signals (A and B respectively from the constant)
The left decider combinator is used to implicitly sum the "count" signals while the "hold" signal is set
The right decider combinator is used to convert a particular range of total "count" into a constant boolean signal
The output is delayed three ticks from the condition being tested (i.e. if the input is false and switches to true, if it remains true, it takes 10 seconds plus 3 ticks for the output to become true; if the input then switches to false, it takes 3 ticks for the output to become false).
That mod is only useful for making large circuits more compact and potentially more UPS-efficient. It does not help with learning the techniques behind construction.