Jump to content
The simFlight Network Forums

Phouillon

new Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    United States

Phouillon's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Thank you Pete. The solution for my situation is the logic.And approach. Now that I understand how you can isolate a bit within the logic.And function, it makes perfect sense. I've spent enough time reading this forum to realize that you handle just about every post yourself and I can imagine the frustration of handling questions that should be solved by reading the documentation. Knowing this, please trust that I spent multiple hours reading the library documents, end-to-end to avoid adding to your load. For some reason my brain was not visualizing how the logic.And function could be used to isolate and evaluate a specific bit. Your advice was extremely valuable and is appreciated!
  2. Hi All, I am sure that there is an obvious answer to this that I have missed. I need to check if a specific bit within an Offset is set. Specifically, Offset 3122. (Radio audio switches) I need to check if the bit in location 2^5 (COM receive both) is set. I am new to working with bits so I apologize if the solution is obvious. I have read Pete's explanations on understanding bits, which were all very helpful. I have found the ipc library functions to work with Offset values to clear specific bits, set specific bits, toggle, etc, but I cannot find a similar function to evaluate the value at a current bit location using a mask. I've read threads to understand how to set specific bits using decimal values. I can't figure out, however, if there is a way to use math to determine if a specific bit is set. I've also reviewed the logic functions within the LUA library and cant figure out how I could use these to achieve my goal. I fear that there is some obvious way to perform this task that I'm missing. The only solution that my small brain could come up with is: 1) Read the 3122 Offset value. 2) Write the value into an Offset that is open to my temporary use. 3) Use the ipc.clearbitsUB function on this temporary Offset to clear all bits except for 2^5 using an appropriate mask. 4) Read the updated value from this temporary Offset location. 5) The decimal value should either be 32 or 0. A value of 32 tells me that the bit at 2^5 is set, 0 tells me that it was not set. Can someone enlighten me on the simple solution for checking if a specific bit is set? Thank you in advance! Prepar3D, FSUIPC 4.957
×
×
  • 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.