Extend pulse for S seconds
-
- Smart Inserter
- Posts: 1161
- Joined: Sat Mar 17, 2018 1:20 pm
- Contact:
Extend pulse for S seconds
Constants block:
Circuit block:
Did you ever have a pulse, but what you need is a signal that stays on for S seconds? For example (but not limited to) to enable a train signal and give a train enough time to pass after its state is evaluated at a Stop and determined that it "can" be allowed through. This will do it.
(It might be possible to do this more efficiently, but I could not find such a circuit so I made this)
COMPONENTS:
- Left block = constant generation.
- Right block = actual circuit.
- Top green constant combinator and lamp are for testing only.
USAGE:
- Set the S combinator to the number of seconds you need the signal to stay on.
- Replace the green constant combinator with whatever creates your pulse (right now it is looking for green > 0 to start operating).
- Replace the lamp with whatever you want to control (right now you should use green > 0 as your device condition).
- NOTE: If instead of a pulse you generate an input signal that stays on... the clock will restart at the end of the S seconds, and keep restarting until you turn the input signal off and it ends its cycle.
- If you need multiples of this circuit, you do not need to repeat the constant generation piece. You can place two circuits and feed them the constants using a red wire, and you can even daisy chain them as shown in the screenshot below.
Chained example:
If you can think of a more efficient/compact way to achieve this, or if you find any errors that need correcting please let me know. I will evaluate the changes and update the post with improvements.
Re: Extend pulse for S seconds
I know this post is old, but this can be done in 2 combinators: an arithmetic combinator set to each % N => each feeding back into itself, connected to both the input and the output of a decider combinator set to each < N => 1 each. N of course being the extender length in ticks.
Bonus: this extends pulses of different signals independently, and you could specify an extender length via another signal on the opposite input, if you so chose.
Bonus: this extends pulses of different signals independently, and you could specify an extender length via another signal on the opposite input, if you so chose.
- Attachments
-
- extender.PNG (56.99 KiB) Viewed 3899 times
Last edited by braxbro on Sun Jan 01, 2023 3:02 am, edited 1 time in total.
-
- Burner Inserter
- Posts: 10
- Joined: Sun Nov 26, 2017 4:03 am
- Contact:
Re: Extend pulse for S seconds
A decider combinator with:thegroundbelowme wrote: ↑Thu Nov 16, 2023 9:48 pm I know what "each < N" means, but I'm fairly baffled by "each < N => 1 each"
Condition: each < N
=>
Output: each 1