Circuit delaying

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Hex-Advure
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jan 21, 2018 1:18 am
Contact:

Circuit delaying

Post by Hex-Advure »

is it possible to have a signal come into the circuit network for a fraction of a second, and have this cause a differant signal to come out for a minute?
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3732
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Circuit delaying

Post by DaveMcW »

Arithmetic combinator: Each - 1 → Each, connected to itself.

Send it a value of 3600 for 1 tick (or 1800 for 2 ticks, or 1200 for 3 ticks, depending on how long it takes you to turn off the signal). It will count from 3600 to 0 for one minute then stop.
Hex-Advure
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jan 21, 2018 1:18 am
Contact:

Re: Circuit delaying

Post by Hex-Advure »

DaveMcW wrote:Arithmetic combinator: Each - 1 → Each, connected to itself.

Send it a value of 3600 for 1 tick (or 1800 for 2 ticks, or 1200 for 3 ticks, depending on how long it takes you to turn off the signal). It will count from 3600 to 0 for one minute then stop.
is there a way i can find out how many ticks a signal lasts for?
User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3732
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Circuit delaying

Post by DaveMcW »

Tick 0: Read input signal
Tick 0: Read countdown combinator output
Tick 1: If input signal > 0, A = 1
Tick 1: If countdown combinator < 1, B = 1800
Tick 2: A * B → C
Tick 2: Pass C to countdown combinator and the combinators in tick 0.

In this case, it takes 2 ticks to turn off the signal.
Hex-Advure
Burner Inserter
Burner Inserter
Posts: 9
Joined: Sun Jan 21, 2018 1:18 am
Contact:

Re: Circuit delaying

Post by Hex-Advure »

DaveMcW wrote:Tick 0: Read input signal
Tick 0: Read countdown combinator output
Tick 1: If input signal > 0, A = 1
Tick 1: If countdown combinator < 1, B = 1800
Tick 2: A * B → C
Tick 2: Pass C to countdown combinator and the combinators in tick 0.

In this case, it takes 2 ticks to turn off the signal.
I don't reallly understand what you mean. i'm knew to circuit networks, sorry.
golfmiketango
Filter Inserter
Filter Inserter
Posts: 549
Joined: Fri Jan 29, 2016 2:48 am
Contact:

Re: Circuit delaying

Post by golfmiketango »

Pretty sure DaveMcW's thing above is a fairly advanced solution to a different question than the one you're actually intending to ask.

If you want to count the amount of time a circuit network didn't change, you can break the question into two questions: "how can I count ticks between pulses", then the only question left is "how can I get a pulse when the circuit network changes?" The second question is pretty easy, you just sum EACH*EACH(-1) arithmetic combinator hooked up to the original signal with the original signal (note the 1-tick discrepancy this creates -- so you are effectively getting the signal right now minus the signal one tick ago), and check if the result is nonzero using a decider. The first... is maybe best answered in a context-dependent manner but probably should involve a decider with its input wired up to its output. This can act a as a sort of "maybe accumulator, maybe forgetter" device.

If this is your first combinator build, you picked a pretty tricky place to start. You might try to find a way to avoid this until you're past the learning curve in the middle of your combinator-education and revisit this topic later.
Post Reply

Return to “Gameplay Help”