Jump to content

Zero-One

Members
  • Posts

    3
  • Joined

  • Last visited

Personal Information

  • Flight Simulators
    DCS, FSX
  • Interests
    Electronics
  1. Yes, thanks ANDROID. With your input plus I've recently converted over to using Quaggles Input Command Injector and Munkwolf's extensive keybinds. Adding the following (mirroring other rotary switches in Munkwolfs keybinds file) does work, but requires an additional button press for value zero (rather than simply: if not 1-7 down, then zero). Out with the soldering iron then! {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0, name = _('Rocket Pair 0'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.11, name = _('Rocket Pair 1'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.22, name = _('Rocket Pair 2'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.33, name = _('Rocket Pair 3'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.44, name = _('Rocket Pair 4'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.55, name = _('Rocket Pair 5'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.66, name = _('Rocket Pair 6'), category = {_('Armament System'), _('Custom')}}, {down = 3011, cockpit_device_id = devices.WEAPON_SYS, value_down = 0.77, name = _('Rocket Pair 7'), category = {_('Armament System'), _('Custom')}}, Appreciate your reply.
  2. Hi all, I have a game controller with an 8-position rotary switch. I have mapped this to the UH-1H Armament Panel Rocket-Pair 8-position switch, but have some odd behaviour. Hoping you can help. In-game the switch positions are marked 0 to 7 (zero rocket pairs selected, to seven rocket pairs selected) My game controller has the switch positions mapped to a button press, so within Windows/control-panel/gamecontroller-settings/properties we see that setting the switch position maps as follows: Physical switch position 7 = game controller Button 18 depressed (only) Physical switch position 6 = game controller Button 19 depressed (only) Physical switch position 5 = game controller Button 20 depressed (only) Physical switch position 4 = game controller Button 21 depressed (only) Physical switch position 3 = game controller Button 22 depressed (only) Physical switch position 2 = game controller Button 23 depressed (only) Physical switch position 1 = game controller Button 24 depressed (only) Physical switch position 0 = no buttons depressed In the UH-1H/joystick/default.lua file, I create the following entry (and I suspect this is where I might have an issue): {down = 3011, value_down = 0.1, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 1", category = _("Armament System"), }, {down = 3011, value_down = 0.2, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 2", category = _("Armament System"), }, {down = 3011, value_down = 0.3, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 3", category = _("Armament System"), }, {down = 3011, value_down = 0.4, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 4", category = _("Armament System"), }, {down = 3011, value_down = 0.5, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 5", category = _("Armament System"), }, {down = 3011, value_down = 0.6, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 6", category = _("Armament System"), }, {down = 3011, value_down = 0.7, up = 3011, value_up = 0.0, cockpit_device_id = devices.WEAPON_SYS, name = "ALT Rocket Pair 7", category = _("Armament System"), }, In-game I go to Settings/Controls and my new Options "Alt Rocket Pair X" are available. I map my game controller buttons 18 - 24 to these new settings 7 - 1 as appropriate. But here's the issue. When I rotate the game-controller knob up, then down, through the full range I get the following behaviour: Controller knob -> Result in-game 0 -> 0 1 -> 1 2 -> 0 3 -> 0 4 -> 0 5 -> 0 6 -> 0 7 -> 0 6 -> 6 5 -> 5 4 -> 4 3 -> 3 2 -> 2 1 -> 1 0 -> 0 So rotating down works perfect, rotating up only works on the first step. Why? Any ideas? If someone else has done it (I'm sure they have - happy just for a link). Thanks for your time.
  3. Hi byteman59, Go to Libraries -> Library Manger and install PCF8575 by Rob Tillaart. Then google "arduino PCF8575 Rob Tillaart" to find the Arduino & github sites. Scroll down on the github site and you'll see the documentation. Also, look through the examples folders for code examples. It's fairly easy to read and write all 16 bits and save them to a uint16_t variable. When you get more experienced, you can read/write individual ports. Some key items: #include <PCF8575.h> // Set address for I2C device PCF8575 PCF(0x20); // set I2C address as appropriate. PCF is your own unique device name. Hex 20 is often the default, but you can add more devices to your I2C bus if you set the links on the PCB to give another unique address. Check if you can find the device and print some debug output: // Initialise I2C I/O expander if (!PCF.begin()) { Serial.println("could not initialize..."); } else { Serial.println("Initialised!"); } // Test is I2C chip is connected if (!PCF.isConnected()) { Serial.println("=> not connected"); } else { Serial.println("=> connected!!"); } Read it to a 16 bit variable called 'x' uint16_t x = PCF.read16(); Code snippets above are from others on the Web - credit to their collective Authors. Good luck Zero-One.
×
×
  • Create New...