hello,
i am starting my build of a AS350, i have found what i think are a great match for the switches on the main swith panel. these are momentary with a led inside. i can find the same swith as a latching version so my question is. how if possible can i make air manager see each press as a alternating command?
(off) - press - (on) (LED ON) - press (off) (LED OFF)
Momentary push button - can i latch?
Re: Momentary push button - can i latch?
Hi
This a matter of coding.
I suggest you create a Boolean Variable like led_on, that can have a value of either false or true.
You first initialize the button state to the startup value, say true.
Then each time you press the button, you alternate the current value by using this trick:
If led_on is true not(led_on) will switch to false.
If led_on is false not(led_on) will switch to true.
Then you act on the led state according to the value of led_on
Jacques
This a matter of coding.
I suggest you create a Boolean Variable like led_on, that can have a value of either false or true.
You first initialize the button state to the startup value, say true.
Then each time you press the button, you alternate the current value by using this trick:
Code: Select all
led_on=not(led_on)
If led_on is false not(led_on) will switch to true.
Then you act on the led state according to the value of led_on
Jacques
My YouTube Chanel on the A320 (Real SOPs by an Airline Pilot IRL):
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
https://www.youtube.com/playlist?list=P ... 0Q6SBASRqJ
Re: Momentary push button - can i latch?
@jonesy1991 Just a quick question - can you link to the switches you are planning to use please ?
Joe. CISSP, MSc.
-
- Posts: 3
- Joined: Thu Aug 05, 2021 1:32 pm
Re: Momentary push button - can i latch?
hello, yes sorry i didn't think of that. i currently have 20 of these for the switch panel
https://www.ebay.co.uk/itm/284266138610
-
- Posts: 3
- Joined: Thu Aug 05, 2021 1:32 pm
Re: Momentary push button - can i latch?
JackZ wrote: ↑Thu Aug 05, 2021 5:24 pm Hi
This a matter of coding.
I suggest you create a Boolean Variable like led_on, that can have a value of either false or true.
You first initialize the button state to the startup value, say true.
Then each time you press the button, you alternate the current value by using this trick:
If led_on is true not(led_on) will switch to false.Code: Select all
led_on=not(led_on)
If led_on is false not(led_on) will switch to true.
Then you act on the led state according to the value of led_on
Jacques
Thank you for this information... I suspected it was possible. I will read up on Boolean variables
Thank you
Re: Momentary push button - can i latch?
Hi @jonesy1991jonesy1991 wrote: ↑Fri Aug 06, 2021 12:11 pmhello, yes sorry i didn't think of that. i currently have 20 of these for the switch panel
https://www.ebay.co.uk/itm/284266138610
Thanks for the link.
Here are some other really nice momentary switch units that may interest you for flight sim use. Very realistic and great price, and, very well made.
https://siminnovations.com/forums/viewt ... 331#p34158
There are more details, including changing the LED colour later in the thread.
I will add your switches to the thread also.
Joe.
Joe. CISSP, MSc.