Jump to content
The simFlight Network Forums

Cool Dan Luke

Members
  • Posts

    7
  • Joined

  • Last visited

  • Days Won

    1

Cool Dan Luke last won the day on January 2 2021

Cool Dan Luke had the most liked content!

Profile Information

  • Gender
    Not Telling
  • Location
    Florida

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Cool Dan Luke's Achievements

Newbie

Newbie (1/14)

2

Reputation

  1. Thank you, that worked. I guess I was expecting it to behave similar like version 7 that adds this entry automatically.
  2. Hi, I have latest version of P3D version 5 and full paid version of FSUIPC. I was following a tutorial using the sample LUA script HidDemo.lua. I replaced the joystick vendor and product id with the correct values. I copied the lua script file into the P3D module folder: D:\Program Files\Lockheed Martin\Prepar3D v5\Modules I enabled logging to see the results. I checked both boxes for the "Log lua files separately" and "Debug/trace lua plugins". However nothing gets logged to screen. Nor there is a separate lua log for my script. I also checked the .ini file to see if the lua script was added to the lua section. Nothing. So I tried dropping the script into the main FSUIPC6 folder: C:\Users\xxx\Documents\Prepar3D v5 Add-ons\FSUIPC6 After restarting P3D, the .ini file now picks up the lua script and adds it to the lua section. However I still don't see any logs. Thoughts?
  3. Hi, I wrote a script that can control the LED's for the annunciator panel and other LED's of the Honeycomb Bravo Throttle Quadrant. Find them on github: https://github.com/danderio/Honeycomb-Bravo-Lua_scripts
  4. Thank you Pete, I was able to figure out how to pass the values out via string.char(n). I've uploaded my scripts to github: https://github.com/danderio/Honeycomb-Bravo-Lua_scripts to share among the community.
  5. Thank you Pete. Following your advice I was able to figure out all the bits corresponding to the lights. I can set the individual lights by calling com.writefeature() and pass in the decimal corresponding to the WORD location of the light I want to activate like this: com.writefeature(dev, "\0\0\0\0\2" , wrf) -- parking brake light on I've mapped all the lights to their individual bit logic and by using the above call I can call them out individually or in sets like this: com.writefeature(dev, "\0\0\0\0\14" , wrf) -- door, low volts and parking brake light on My question now is, what is the recommended method for turning bits on and off in my program? The method used above of expressing the parameter using back slashes seem unorthodox. I tried passing various other combinations to the writefeature function like decimals or hex, or hex strings like this "0XC". Nothing worked except the "\" notation above. Also, what's the best way to manage the bits on and off? For example, what if I want to turn off the "low volts" light that corresponds to the 3rd bit without affecting the other bits, so I would need to pass a decimal 9, but how to do this using bitwise operators and logic functions like AND and OR? Thanks for your help Pete, I realize this question is specific to LUA programing and not with FSUIPC, thanks for your patience.
  6. Hi, So I want to be able to control on the LED's that come with the Honeycomb Bravo throttle quadrant. This "joystick" has plenty of lights and LED's that should be fully addressable programmatically. I haven't found an interface built for it (nor any other API for that matter). My goal is to be able to use FSUIPC / LUA to control the lights. I'm not sure how or what libraries I need. Would it be even possible to do without library support from Honeycomb?
  7. I'm trying to program LUA script to detect the toggle switches in Honeycomb Bravo throttle quadrant. The switches are 34 to 47. I tried the following: Capture button events using event library: event.button(HCA, 34, "Function_ProcessButton34") This event never fires. I tried with switches lower than 32 and they work. Nothing fires for switches 32 and higher. Read button states during Poll event like this: buttons[33], buttons[34], buttons[35], buttons[36], buttons[37], buttons[38], buttons[39], buttons[40] = com.GetHidButtons(dev, CurrentData) I get a value only in the first two locations: buttons[33] = 1191247872 buttons[34] = 13106 buttons[35] thru buttons[40] are empty I'm not sure how this translates into an actual button state. I've read thru the documentation and examples but couldn't find how to read buttons higher than 32. Thanks for any suggestions on how to resolve this. Update: I figured out how to update the buttons during the polling function above: I used the example HidDemo.lua script in the examples folder. Basically, we need to let FSUIPC know what something changed via this function: ipc.writeUD(0x3340 + ((i-1) * 4), buttons[34]). Then the event will register with FSUIPC and can be used to program the "virtual" button.
×
×
  • 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.