Short or Long Press a button- 2 Functions

Questions about deployment and use of Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
aerostar
Posts: 4
Joined: Wed Jun 16, 2021 3:15 am

Short or Long Press a button- 2 Functions

#1 Post by aerostar »

UPDATE ...... Have worked out a way... check later posts ------

Can anyone help me get my head around code that will select different functions if I -- Press a Button once -- or -- Press a Button Twice -- ?

This is to make a work around to the Push/Pull Rotary Buttons used on the Fenix A320.

If I Press once then that selects 'Managed' mode and if I press twice that selects 'Set' mode.

I've tried to involve the TIMER function in AM but its hard for me to work out how to use it...

I have back checked previous posts but couldn't find anything relevant
Thanks

PS - Would be good if it could be made to have 3 functions - with a Long press too.
Last edited by aerostar on Wed Jun 15, 2022 4:40 pm, edited 2 times in total.

aero
Posts: 7
Joined: Mon Jan 25, 2021 4:36 pm

Re: Single or Double Press a button

#2 Post by aero »

OK I have managed to get something working...

Here is some code for " Single Fast " and " Single Slow " push on a button to give 2 inputs from 1 button... I am new to this and hopefully someone can do a better job. It works ok for me on FNX A320 HDG Rotary , will adapt for the SPD and ALT and maybe the VS.

https://discord.com/channels/9261771675 ... 3903574066

FNX320 Double Push Rotary.lua
(610 Bytes) Downloaded 77 times

aerostar
Posts: 4
Joined: Wed Jun 16, 2021 3:15 am

Re: Single or Double Press a button

#3 Post by aerostar »

OK cant get into last post and edit out the discord link which is wrong....

https://i.gyazo.com/b0cfa99bb09d6b4576b ... 15dfc8.png

This one should work .....

IMPORTANT NOTE:- This works with ' SHORT PUSH ' and
' LONGER PUSH ' . This should work on any button to give 2 inputs.
Change the 320 figure to adjust the time delay [ms] .

Post Reply