Jump to content
The simFlight Network Forums

Compound button question


Recommended Posts

Hi,

First of all many thanks to Pete for adding the new bit changing facilities to the new FSUIPC version!

Now - if I may - I have a different question:

What I want to achieve is the a tiny part of the 737 logic regarding the autopilot disconnect button on the yoke.

In the real thing the first press disconnect the autopilot (which I do via the 2040 control PM MCP AP Disc (not 747)), whereas the second press on the same button extinguishes the red A/P disconnected light on the MIP.

I tried achieving this with setting a button-flag and another offset for the second press, but it doesn't work.

Tried this:

1=PA,2,C1005,3842

2=CP(F+A,2)A,2,C2040,0

3=CP(F-A,2)A,2,Cx090056BA,x20

Can you give me any advice how it can be done?

best regards

Potroh

Link to comment
Share on other sites

In the real thing the first press disconnect the autopilot (which I do via the 2040 control PM MCP AP Disc (not 747)), whereas the second press on the same button extinguishes the red A/P disconnected light on the MIP.

I tried achieving this with setting a button-flag and another offset for the second press, but it doesn't work.

Tried this:

1=PA,2,C1005,3842

2=CP(F+A,2)A,2,C2040,0

3=CP(F-A,2)A,2,Cx090056BA,x20

Line 1 toggles button flag 15,2 -- i.e. button 2 on joystick 15. Why are you toggling that when you don't test it anywhere? Or is your joystick A number 15?

In the compound lines you are testing the same button's own flag, A,2. That flag is automaticaly toggled every time you press the button. So if A = 15 you are toggling the flag twice every time it is pressed . The result of that will be that the flag never changes.

The "toggle flag" control (1005) is one of the set of flag manipulating controls intended to allow you to use sets of flags for buttons you don't truly have, out of the 16x32 = 512 possible buttons. But for merely having an alternate action from a button the auto-toggling of real button flags is fine. So, if A=15 remove line 1.

Otherwise, I don't know. You'll need to switch button logging on -- that will tell you what is happening.

Regards

Pete

Link to comment
Share on other sites

Line 1 toggles button flag 15,2 -- i.e. button 2 on joystick 15. Why are you toggling that when you don't test it anywhere? Or is your joystick A number 15?

Hi Pete,

Many thanks again, and my example was wrong indeed, just mixed up the joystick before thinking of the example.

Anyway I found that it is much easier to do in lua, so it works now.

thanks and regards

Potroh

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use. Guidelines Privacy Policy We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.