Hello, I would like some help with a code for making lights blink back and forth like this
I tried the 0,0.5,0.5,0 format and overtime they overlap, help would be highly appreciated and I'll be sure to give credit whenever I use it. Thank you in advance.
Help with some lights
6,831 Skykid028
2 months ago
@Skykid028 okay. Just a minute.
@overlord5453 I am so sorry but the lights still remain off. Do you think you can make a quick build with the two lights with the codes inputted in them
@Skykid028 this will work
Activate1? round(sin(sum(360 * 1)) = 1 : 0
Activate1? round(sin(sum(360 * 1)) = -1 : 0
No overlapping, no turning off. Beacons are set to steady. You can also use
Activate1 & round(sin(sum(360 *1)) = 1
Activate1 & round(sin(sum(360 *1)) = -1
Does the same thing as before.
Turns out, the previous code didn't output
1
or-1
but something like0 to 0.998626
and0 to -0.9737377
. But this time the output is rounded and is0 to 1
and0 to -1
.@overlord5453 so I tried your new code and nothing unfortunately, they both just stayed off
@Skykid028 you only have to do it once. Turn on, turn off then on again and it will be the way you want it to be. Atleast as far as I tested and i don't really know why this occurs. If you didn't like it try this, first set beacons to steady then
Activate1 ? (sin(sum(360 * 1)) = 1) : 0 in one of the beacons and Activate1 ? (sin(sum(360 * 1)) = -1) : 0 in the other.*1 controls speed. Change it your liking.
@overlord5453 I'm not really a fan of having to play The guessing game when you turn them off and turn them back on for a second time but after a while you get the right blink pattern you're looking for so yeah thank you 🙂
@Skykid028 glad I could help.
@overlord5453 awesome thank you, that's exactly what I was looking for
@Skykid028 activate and deactivate them then activate again, it will work. I should have brought that up earlier.
@overlord5453 I don't mean to play 100 questions but when I put this in the input on one they both blink at the same time. I'm guessing that's not where it goes?
@Skykid028 exactly....... Wait no
Like this
smooth(clamp01(Activate1),1/0.5)
. 0.5 is the delay in seconds.@overlord5453 so like this
(smooth(clamp01(Activate1)))
By the way, it's the code for landing gear I copied from an in game plane. I have repurposed it for this and some other things where I needed a delayed input.
@Skykid028 okay, try this
Put
0.5, 0.5
on both. But this time give each of them input.whatever input you want
on the first beacon and(smooth(clamp01(the input used in the first beacon),1/0.5)
on the second beacon. The result will be the beacons blinking one after the other at0.5sec
Itervel. Because what you are trying to achieve here is something simple, it's best to use this instead of messing with the blink program.@Skykid028 hmm. I will get back to you after some testing.
@WisconsinStatePolice and @overlord5453 think both of y'all but they bounce all over the place
Try
0.5,1,0.5,1
on one side and0,0,0.5,1
on the other. Haven't tested this myself but give it a try. Just came up with it so no guarantee.I think this is the original which I pulled the codes from, made by Skely. [link]
0,0.5,0.5
and
0.5,0,0.5
might work. I haven’t tried it in a while. Tell me if it doesn’t work and I’ll pull the code for you.