Jump to content
The simFlight Network Forums

Pitch and roll accel. In visual basic 2010


hks76
 Share

Recommended Posts

I want to read the pitch and roll in visual basic 2010.

To use any offset you need to follow this procedure: (This example will use Pitch)

1. Look in the "FSUIPC4 Offsets Status.pdf" (from the SDK) for the offset address. A search for "Pitch" finds 0578.

2. Get the size from the size column (in this case 4 bytes).

3. Read the description to see if a data type is mentioned and if the data is signed. (There is no data type mentioned in this case so we assume some kind of integer type. We can also read that the data is signed).

4. From the table on page 7 of my UserGuide.pdf we read that an integer type of size 4 that is signed corresponds to the VB.NET type of 'Integer'. Thus we declare the offset:

Dim Pitch As Offset(Of Integer) = New Offset(Of Integer)(&H578)[/CODE]

5. After the Process() call, when we want to use the data, we use the conversion described in the "FSUIPC4 Offsets Status.pdf" document to get the data into human readable format.

[CODE]
Dim PitchDegrees As Double
PitchDegrees = Pitch.Value * 360.0# / (65536.0# * 65536.0#)[/CODE]

(The # signs are appended to the values to tell the compiler that these are to be Doubles and not Integers.)

You can now apply this process to any offset you want and know how to use it. Roll (also called Bank) is at 057C.

Paul

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • 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.