Repeat while pressed

Help creating logic scripts for Air Manager Instruments

Moderators: russ, Ralph

Post Reply
Message
Author
ereuter
Posts: 14
Joined: Sun Mar 29, 2020 5:13 pm

Repeat while pressed

#1 Post by ereuter »

I'm trying to figure out the logic to repeatedly send a command (flaps down) to XP while a momentary button is pressed. The Grumman Tiger I'm flying has a momentary toggle switch to move the flaps up and down, but the up and down commands are very small increments. The physical switch is attached to an Arduino as two buttons. Its a ON-OFF-ON type, so the center is neutral.

Thanks!

User avatar
Ralph
Posts: 7916
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Repeat while pressed

#2 Post by Ralph »

You could start a timer with the pressed callback, which sends a flaps up or down command every x milliseconds. Then stop that timer with the released callback.

User avatar
Keith Baxter
Posts: 4684
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Repeat while pressed

#3 Post by Keith Baxter »

AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

User avatar
Ralph
Posts: 7916
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Repeat while pressed

#4 Post by Ralph »

I'm not sure if a begin and end will work with flaps, but maybe?

User avatar
Keith Baxter
Posts: 4684
Joined: Wed Dec 20, 2017 11:00 am
Location: Botswana

Re: Repeat while pressed

#5 Post by Keith Baxter »

Ralph wrote: Mon Mar 07, 2022 4:39 pm I'm not sure if a begin and end will work with flaps, but maybe?
Ralph,

The OP said...
The Grumman Tiger I'm flying has a momentary toggle switch to move the flaps up and down
So one can assume that when the switch is in the (ON) position it sends commands ("BEGIN") until it is in the OFF position and then sends command ("END").

But it could be different.

Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board,  32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card 

ereuter
Posts: 14
Joined: Sun Mar 29, 2020 5:13 pm

Re: Repeat while pressed

#6 Post by ereuter »

I’ll try begin and end. I had forgotten that those existed. I wrote my scripts a couple years ago for a 172 and am conveying them. Thanks.

User avatar
Ralph
Posts: 7916
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Repeat while pressed

#7 Post by Ralph »

Maybe, I've never tried it. But certainly worth a try.

Post Reply