June 9, 200520 yr Moderator I need an XML timer that will turn ON a variable for X seconds every Y seconds. So far, I've been unsuccessful in this venture.I want to create a "fake ATC interrogation request" every 40 seconds or so, and have the "R" displayed for about 5 seconds or so.This is such a trivial bit of code in C, but I just can't seem to get my head wrapped around the solution! :(I do know that it requires two timer circuits; one to initiate the "Interrogation," and another to keep the "R" displayed for 5 seconds, and that the "R" timer needs to be nested in the "Interrogation" timer.I'd be deeply grateful for any help! ;) Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 10, 200520 yr Moderator It never fails! One minute and thirty-seven seconds after posting a plea for help... I find a solution... ;)It ain't pretty, but it's functional:(L:ATC_FakeTimer,seconds) 1 + (>L:ATC_FakeTimer,seconds)(L:ATC_FakeTimer,seconds) 360 > if{ 1 (>L:ATC_Fake,bool) (L:ATC_FakeTimer,seconds) 450 > if{ 0 (>L:ATC_FakeTimer,seconds) 0 (>L:ATC_Fake,bool) } } Fr. Bill AOPA Member: 07141481 AARP Member: 3209010556 Avsim Board of Directors | Avsim Forums Moderator
June 10, 200520 yr Author or(L:ATC_FakeTimer,seconds) 1 + s0 (>L:ATC_FakeTimer,seconds) l0 39 > if{ (>L:ATC_Fake,bool) } l0 44 > if{ 0 (>L:ATC_FakeTimer,seconds) 0 (>L:ATC_Fake,bool) }not testednick
Create an account or sign in to comment