- Messages
- 657
- Country
I'm trying to adapt the code sample presented in the "XML Timer" wiki article to a pair of alternating beacon lights on my aircraft. I have a working code for both lights flashing simultaneously, but haven't found a way to add a specified delay to one and produce the alternating effect. My idea was to use my current code for one light and an offset version for the other.
The sample pseudocode...
What I have now...
Now, I've found various other codes that omit the second "seed" entry and the following asterisk, which works exactly the same way as above. But I can't figure out how to add an offset of half the total cycle time to one of these lights. Also, the second "seed" value seems to only scale the previous term.
So how would I go about adding a delay to only the first "blink" while leaving every other cycle untouched? It seems like a very simple task but I have yet to find anything relevant and useful on the interwebs.
The sample pseudocode...
Code:
<Visible>(P:Absolute time,seconds) "seed" % "blink lapse" "seed" * > !</Visible>
What I have now...
Code:
<PartInfo>
<Name>605_beacon</Name>
<Visibility>
<Parameter>
<Code>
(A:LIGHT BEACON,bool)
(A:ELECTRICAL MASTER BATTERY,bool)
and
if{
(P:Absolute time,seconds) 1.7 % 0.1 1.7 * > !
if{ 1 } els{ 0 }
}
</Code>
</Parameter>
</Visibility>
</PartInfo>
Now, I've found various other codes that omit the second "seed" entry and the following asterisk, which works exactly the same way as above. But I can't figure out how to add an offset of half the total cycle time to one of these lights. Also, the second "seed" value seems to only scale the previous term.
So how would I go about adding a delay to only the first "blink" while leaving every other cycle untouched? It seems like a very simple task but I have yet to find anything relevant and useful on the interwebs.
Last edited: