Jump to content
The simFlight Network Forums

User defined offsets? How to read a switch and toggle a "custom offset"?


Recommended Posts

Pete,

I have a hardware switch that I would like to have work as a test switch for a hardware annunciator. The

Is it possible to hook a switch in through a HID card (buo836x) and have it read by (something???) and write to a fsuipc offset? It would just be a simple toggle function, i.e. Toggle test switch, with the options being open or closed.

My output interface/card could then make all of the annunciators light.

I understand there are offsets available for customization at the user end, but how does one go about this?

Hope I am making sense, and this would not be too tricky.

Reid

Link to comment
Share on other sites

Is it possible to hook a switch in through a HID card (buo836x) and have it read by (something???) and write to a fsuipc offset? It would just be a simple toggle function, i.e. Toggle test switch, with the options being open or closed.

The Leo Badnar cards, connecting through USB, look like regular joysticks with up to 8 axes and 32 buttons, so FSUIPC's buttons & switches tab will see them easily and you can assign there.

There is a selection of assignable controls in the dropdown for manipulating FSUIPC offsets -- set, clear, toggle, increment, decrement, etc. Please check the documentation. There are examples too. All the offset control names start with thr word "offset" so easy to find. When opening the drop-downs just press "o" to get to the 'o's' -- or even "o f f" in quick succession.

I understand there are offsets available for customization at the user end, but how does one go about this?

The offsets available for general use are x66C0 to x66FF inclusive. And you use them by assigning to the offset controls. Please check the documentation about this. There's at least one example in the User Guide.

Pete

Link to comment
Share on other sites

Pete,

I have looked in the docs, and it seems it should be straightforward unless I am mistaken...yet I am not seeing results. Am I missing something?

What I am doing is:

1. going to the keys tab

2. assigning a key to the control "Offset Byte Togglebits"

3. choosing offset x66C0

4. parameter set as toggle

Then upon confirming and returning to fsx, nothing seems to happen to 66CO in the fs window when I monitor it through the logging tab.

What may I need to do to make the button (which will eventually be a switch) change the value?

Reid

Link to comment
Share on other sites

Upon looking at it again, I see that the parameter is actually x00. Don't know if this is important.

The parameter tells "toggle bits" which bits to toggle. How else can it know which bits you want to toggle? It does not guess -- it might be wrong!

By setting parameter 0 you are saying "toggle no bits" -- i.e. do nothing.

A parameter of 255 or xFF toggles all 8 bits in the byte (255 decimal = FF hexadecimal). You can toggle one bit by giving its value, i.e. 1, 2, 4, 8, 16, .... 128 for the separate 8 bits, or any othr value to toggle whatever selection of the 8 bits you wish.

If you only want to set a specific value you must use "offset byte set" not "togglebits". Then the value is given as the parameter. The parameter is always important.

Please see the FAQ subforum thread about bits and numbers.

Pete

Link to comment
Share on other sites

Thanks for the clarification about the parameter setting. That did it for my little project. I am able to use the output although it now toggles between 0 and -1. Why would the number go negative if I put in xFF as the parameter?

Depends how you read it. In an Unsigned Byte, xFF is 255, in a Signed Byte it is -1. Unsigned values go from 0 to 255, signed values go from -128 to +127.

Regards

Pete

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.