Circuit delaying
-
- Burner Inserter
- Posts: 9
- Joined: Sun Jan 21, 2018 1:18 am
- Contact:
Circuit delaying
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?
Re: Circuit delaying
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.
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.
-
- Burner Inserter
- Posts: 9
- Joined: Sun Jan 21, 2018 1:18 am
- Contact:
Re: Circuit delaying
is there a way i can find out how many ticks a signal lasts for?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.
Re: Circuit delaying
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.
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.
-
- Burner Inserter
- Posts: 9
- Joined: Sun Jan 21, 2018 1:18 am
- Contact:
Re: Circuit delaying
I don't reallly understand what you mean. i'm knew to circuit networks, sorry.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.
-
- Filter Inserter
- Posts: 549
- Joined: Fri Jan 29, 2016 2:48 am
- Contact:
Re: Circuit delaying
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.
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.