Jump to content

No1sonuk

Members
  • Posts

    1594
  • Joined

  • Last visited

Everything posted by No1sonuk

  1. Then use the active high version - it's what the LED code was designed for.
  2. If you try the "active low" wiring from my first response to this thread, it might do what you want.
  3. OK. But those are not what you asked about. You asked about 2 different controls. The "0x0800" is the "bit mask" to isolate the bit you want from the "0x110C" address. The rest of my response stands. The LED code switches an LED on and off dependent on the state of the bit. The IntergerBuffer code feeds the value (1 or 0 in this case) into a function you write. "DcsBios::IntegerBuffer efcpMrfcsBuffer(0x110c, 0x0800, 11, onEfcpMrfcsChange)" means take bit 0x0800 from address 0x110c, shift it 11 places to the right, then feed it to the function named "onEfcpMrfcsChange". The shift is so that the value is 1 or 0 rather than 2048 or 0. DcsBios::LED efcpMrfcs(0x110c, 0x0800, LED_PIN); Will do the same as this: void onEfcpMrfcsChange(unsigned int newValue) { if (newValue == 1) { digitalWrite(LED_PIN, HIGH); } else { digitalWrite(LED_PIN, LOW); } } DcsBios::IntegerBuffer efcpMrfcsBuffer(0x110c, 0x0800, 11, onEfcpMrfcsChange); But the second one could also be used to carry out other actions based on the newValue number.
  4. DcsBios::LED efcpMrfcs(0x110c, 0x0800, PIN); Lights an LED as an indicator for a switch input. DcsBios::IntegerBuffer efcpTrimOverrideBuffer(0x110c, 0x0004, 2, onEfcpTrimOverrideChange); Runs the code in the onEfcpTrimOverrideChange function when the switch changes. Note they're for different switches
  5. When asking questions about individual DCS-BIOS functions for a specific aircraft, PLEASE at least say WHICH aircraft it is so people can find it easily if they don't already know what it is. The DCS-BIOS version would help too. Thanks.
      • 1
      • Like
  6. On my computer, that is the full path - I have DCS on a separate SSD. E:\dcs-bios-master\Programs Get the zip from here: https://github.com/DCSFlightpanels/dcs-bios There's an installation guide here: https://github.com/DCSFlightpanels/dcs-bios/blob/master/Scripts/DCS-BIOS/doc/DCS-BIOS-FLIGHTPANELS_Install Guide.pdf
  7. It's in the dcs-bios-master\Programs folder
  8. Actionbutton might work, but I'm not sure how to use it without looking it up.
  9. Yes. Flightpanels is actively updated. Hub currently isn't.
  10. If you're using the Flightpanels fork of DCS-BIOS, it should be relatively easy to get it updated. I don't know if the Hub version can be currently.
  11. IIRC, he uses Bodnar boards for his switch and analogue inputs.
  12. DCS-BIOS keeps the switch on if the physical switch is on, and it overrides the game. I'm not sure if actionbutton would work. My plan for a similar switch is a hybrid of HID and DCS-BIOS.
  13. I powered my 487s with 5V from the arduino regulators. Connected to the 5V pin means it gets power no matter how you power the arduino. As for connecting DCS-BIOS: I regularly connect and disconnect USB-connected arduinos with no issues while a mission is running. I use the Flightpanels fork. I don't know if the connection problems are related to the Hub version.
  14. This was just suggested: https://github.com/DCSFlightpanels/dcs-bios-arduino-library/blob/master/examples/Synchronization/Synchronization.ino
  15. Should be OK. As far as I can see, the MAX487 draws a couple of mA in normal operation. As for the current the Nano can supply, the second answer here is interesting: https://arduino.stackexchange.com/questions/35121/max-current-of-vin-and-5v-pin-on-arduino-nano Because of the heat the regulator has to dissipate, you could draw more current from the Nano if you used 9V or 7V VIN. If you're running RS485 about anyway, why not run a 5V rail with it? Have a decent current regulator or two in central location(s) that you can fan cool and run 5V with the RS485 - That's how I designed my Nano breakout. I included a 4-wire RS485 bus:- 5V, GND, two signal.
  16. Are you using Hub or Flightpanels Fork? I've posted a link to this thread on the Flightpanels Discord.
  17. Looks like there are a few bugs with the throttle system: 1) The animation of the twist grip goes the wrong way. IIRC, twist right should be closed. 2) The throttle twist doesn't respond to the "both engines throttle" axis input. 3) The both engines throttle axis input doesn't work until after the engines are started. 4) The throttle idle position has no stop, meaning you can't tell where it is unless you have the prompts on. 5) The throttle needs to fully open for the engine to start (matches realistic idle position of twist fully right)
  18. Not sure if it's the case, but I would have thought the F18 displays send ASCII characters from DCS because some of them are text. This would mean the zero would be sent from DCS as 40 in decimal, one is 41 and so on. I can't see if your code accounts for that.
  19. +1 for trying a capacitor. Though I usually use 0.1 uF (100nF).
  20. Someone asked about this on the FlightPanels Discord, so I thought I'd post here. This is how easy it is to run a combination of DCS-BIOS and a HID on the same Arduino. It uses a Leonardo or Pro Micro (needs the 32u4 processor). This example is for the TF-51D, so anyone can try it. /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. */ #define DCSBIOS_DEFAULT_SERIAL #include <Joystick.h> Joystick_ Joystick; #include "DcsBios.h" int landingGearRedButton = 2; // Pin for button /* paste code snippets from the reference documentation here */ DcsBios::LED landingGearRed(0x500e, 0x2000, LED_BUILTIN); void setup() { DcsBios::setup(); pinMode(landingGearRedButton, INPUT_PULLUP); Joystick.begin(); } void loop() { DcsBios::loop(); Joystick.setButton(1,!digitalRead(landingGearRedButton)); } Program the Arduino, then connect it to DCS-BIOS. Fire up DCS and start a TF-51D cold start instant action mission. Press ESC and go to adjust controls. You should see a column for your Arduino device. Scroll down to "Landing Gear Unsafe Light Test", right click on the control box and "add combo". Press the Arduino button, then click OK. Go back to the cockpit and turn on the battery (right side panel). The green landing gear light should illuminate. Press the Arduino button, and the red light next to the green should come on, and the lamp surround presses in. The built-in LED on the Arduino should come on as well. Then press the Red indicator in the cockpit, and again, the cockpit and Arduino LEDs should light. What you now have is an Arduino sending button presses as an HID, and receiving feedback from DCS via DCS-BIOS.
      • 3
      • Like
      • Thanks
  21. I did a test where I used Chep's inlay method to print the backlit text part first in a couple of layers of white. Then print the main part in black (with text cut out) using Z-hop.
  22. 3.5mm sockets usually have switch contacts to disconnect speakers when you plug in headphones. DC power connectors usually have something similar to disconnect the battery. You could use that, or just connect two of the plug contacts together and program the electronics to react to the contact being broken.
  23. OK. That line was from the Flightpanels fork control reference. It looks like Hub doesn't have that light available.
  24. I've found reed switches to be a PITA to get to work well. If you run too much current, they weld together, and I've had at least one stick magnetically. A microswitch with a lever bent for strain relief has more reliable contact, can handle more current, and can be wired NO or NC depending on the application. If I wanted non-contact, I'd go with beam-break optical.
  25. A microswitch held down by the handle would be more reliable. They can usually be wired as normally-open or normally-closed, making the electrical connection easier than a magnetic switch.
×
×
  • Create New...