Cool Dan Luke Posted December 23, 2020 Report Posted December 23, 2020 (edited) 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? Edited December 23, 2020 by Cool Dan Luke
Pete Dowson Posted December 24, 2020 Report Posted December 24, 2020 14 hours ago, Cool Dan Luke said: 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? It would be possible using the COM and HID facilities in the FSUIPC lua libraries. But you'd need to do a bit of research. There are HID facilities to read axes and buttons, but nothing specific for displays of any sort -- as far as I know there's no fixed defined way for dealing with displays. The LEDs may be encoded in the HID data as "features" in which case they should be controllable via the com.writefeature call. I'm afraid, however, that you'd either need information supplied by the makers, or do your own investigation using a USB monitoring program whilst running their supplied software to operate the LEDs. Pete
Cool Dan Luke Posted December 27, 2020 Author Report Posted December 27, 2020 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.
Pete Dowson Posted December 28, 2020 Report Posted December 28, 2020 13 hours ago, Cool Dan Luke said: 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. \0 is simply a zero byte, so equivalent to 0x00. What you are sending with "\0\0\0\0\2" is in fact the value 0x000200000000 including the additional zero at the end of the string. Intel style processors use Lo-Hi order, so the first byte is the least significant. Your use of a string for this is reasonable and compact, so I wouldn't worry about what method you use. Well done on the detective work!! Pete
Cool Dan Luke Posted January 2, 2021 Author Report Posted January 2, 2021 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. 1
Pete Dowson Posted January 2, 2021 Report Posted January 2, 2021 8 hours ago, Cool Dan Luke said: I've uploaded my scripts to github: https://github.com/danderio/Honeycomb-Bravo-Lua_scripts to share among the community. Could you post something about it to the User Contributions subforum, please? There it will have a longer life and be more easily found by other users. Thanks, Pete
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now