I'm trying to figure out a way to set the programmable speaker to ring when the lamp on the LTN station is yellow ("incoming train"). I hooked the speaker up to the lamp, but I'm unclear on what the lamp settings should be to detect "yellow" on the lamp?
Thanks!
Detecting incoming train
Moderator: Optera
Re: Detecting incoming train
if the color yellow is > 0
And for the lights, anything > 0 with colors enabled.
And for the lights, anything > 0 with colors enabled.
Re: Detecting incoming train
Dune's suggestion definitely does exactly what you ask. My goal was a bit different, so my solution was too. I wanted the speaker to go off not just when the light was yellow, but also while it was red. I only wanted it to be inactive when the light was green. There appears to be no way to trigger a circuit effect with more than one condition being met. So I set it to trigger in the case of a green signal instead, and to be "off" when "green." This worked for my purposes. But I do have a question. Why does it seem as if in the condition specified in the Circuit connection settings creates a behavior which will only trigger when that condition is NOT met, instead of when it IS met? It seems counter-intuitive for it to work this way. My screenshot shows how I set it up, and as you can see, the "light equals green" condition is specified. But the resulting behavior is one which makes the speaker NOT play (the effect triggers when the condition is false). Yet it seems natural to me to expect the specified condition to make the speaker play (the effect triggers if the condition is true).
- Attachments
-
- train warning.jpg (728.27 KiB) Viewed 4699 times
Re: Detecting incoming train
Your condition is simply wrong, you compare the amount of lamp items against the value of the circuit signal "green", since both are zero in case of a non green train signal you get accidentally the inverted behaviour of what you actually want.R-800 wrote:Dune's suggestion definitely does exactly what you ask. My goal was a bit different, so my solution was too. I wanted the speaker to go off not just when the light was yellow, but also while it was red. I only wanted it to be inactive when the light was green. There appears to be no way to trigger a circuit effect with more than one condition being met. So I set it to trigger in the case of a green signal instead, and to be "off" when "green." This worked for my purposes. But I do have a question. Why does it seem as if in the condition specified in the Circuit connection settings creates a behavior which will only trigger when that condition is NOT met, instead of when it IS met? It seems counter-intuitive for it to work this way. My screenshot shows how I set it up, and as you can see, the "light equals green" condition is specified. But the resulting behavior is one which makes the speaker NOT play (the effect triggers when the condition is false). Yet it seems natural to me to expect the specified condition to make the speaker play (the effect triggers if the condition is true).
Use "green" = value 0.
Re: Detecting incoming train
You can change what a rail signal outputs.
If you want a one-wire yellow-or-red-rail-signal output, set both the yellow-rail-signal and red-rail-signal slots to output the same circuit signal. String multiple rail blocks together along the wire to get a longer advance notice.
If you want a one-wire yellow-or-red-rail-signal output, set both the yellow-rail-signal and red-rail-signal slots to output the same circuit signal. String multiple rail blocks together along the wire to get a longer advance notice.