I am making an Altitude Alerter, that alerts when you are withing 200 feet of your selected altitude, and once you have reached the selected altitude, it will alert when you deviate more than 200 feet.
This is a visual alerter, and the deviation alert blinks, as opposed to the "Level Off within 200 feet" witch is constant.
I have everything working, for test purposes I used a different color bitmap for the 2 alerts. Now that it is working, I want to make the deviation bitmap blink, but I cannot get it to work.
I have tried to use a variable that increment, once it is at a certain number it toggles a second variable that the Visible field on the bitmap reads, then resets the first variable. I think this approach should work, but I cannot get the code to keep incrementing.
Here is both notations, in case my RPN is messy.
@SAD is a macro to for the difference indicated altitude, and selected altitude.
I put this code the script of an Update Object, tried freq 0 and 60, but L:Blinker increments to 1 after deviating more than 200 feet then stops.
This is a visual alerter, and the deviation alert blinks, as opposed to the "Level Off within 200 feet" witch is constant.
I have everything working, for test purposes I used a different color bitmap for the 2 alerts. Now that it is working, I want to make the deviation bitmap blink, but I cannot get it to work.
I have tried to use a variable that increment, once it is at a certain number it toggles a second variable that the Visible field on the bitmap reads, then resets the first variable. I think this approach should work, but I cannot get the code to keep incrementing.
Here is both notations, in case my RPN is messy.
Code:
if ( @SAD > 200 )
{
(L:Blinker, number) + 1 ;
if ( (L:Blinker, number) == 60 )
{
(L:Dev Alert Vis, bool) = ( ! (L:Dev Alert Vis, bool) ) ;
(L:Blinker, number) = 0 ;
}
} else
(L:Dev Alert Vis, bool) = 0 ;
}
Code:
@SAD 200 > if{ (L:Blinker , number) 1 (L:Blinker , number) 60 == if{ (L:Dev Alert Vis , bool) ! + (>L:Dev Alert Vis , bool) 0 (>L:Blinker , number) } } els{ 0 (>L:Dev Alert Vis , bool) }
@SAD is a macro to for the difference indicated altitude, and selected altitude.
I put this code the script of an Update Object, tried freq 0 and 60, but L:Blinker increments to 1 after deviating more than 200 feet then stops.

