

No1sonuk
Members-
Posts
1601 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by No1sonuk
-
+1 for trying a capacitor. Though I usually use 0.1 uF (100nF).
-
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
-
-
-
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.
-
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.
-
OK. That line was from the Flightpanels fork control reference. It looks like Hub doesn't have that light available.
-
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.
-
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.
-
Which version of DCS-BIOS do you use?
-
As we're sharing "Crap-O-CAD", this is an idea I had a while ago for a mechanical solution. I'd personally use an Arduino and code it, but that's not desirable for some.
-
That second video brought to mind a design consideration I came across yesterday while planning my own such device to add to my WH Throttle: You should decide where to put your buttons/switches carefully. There's a lot of space under the red buttons in that video that someone might be tempted to use for more buttons. That's OK, BUT those buttons can't be accessed if the throttle levers are forward... So only put switches there that will be used with the throttles back.
-
Try: DcsBios::LED lightEcm(0x4520, 0x0400, PIN);
-
If you go the arduino as HID route, i.e. making it appear as a joystick, you need to use one with a 32u4 processor. The Pro Micro and Leonardo are such units. The Leonardo is the same form factor as an Uno, but has the different processor. If you go that route, it's possible to get around some issues that simple "zero delay" boards, like the Bodnar boards, have with some controls in DCS not "turning off" when the button does. With the arduino, you can easily create sequences of button presses with numbers beyond the pins you have. This is particularly useful if you have a centre-off switch. DCS-BIOS can be better for some controls, but it is module-specific. A HID setup can be remapped for different aircraft (or a different sim) more easily.
-
The Arduino pro micro can behave like a keyboard or joystick, then you could use something like Joy2key to interpret those button presses and run files.
-
Seen this a few times, but I can't find a specific how-to with code.
-
-
Arduino or Zero Delay Encoder for 3-way switches?
No1sonuk replied to durka-durka's topic in Home Cockpits
Use a "virtual button" for the centre position. Read the two inputs in one code block and set the 3 output "buttons" appropriately: Input_A = off, Input_B = off (Centre) gives button 12 = off, button 13 = on, button 14 = off Input_A = on, Input_B = off (Up) gives button 12 = on, button 13 = off, button 14 = off Input_A = off, Input_B = on (Down) gives button 12 = off, button 13 = off, button 14 = on I showed a way to do this here: -
How did you do it? I've seen it mentioned a few times, but no actual code given.
-
Covered toggle switch where cover can trigger event?
No1sonuk replied to TEMPEST.114's topic in Home Cockpits
Thanks. Link added to my post. -
That unit is for 19 inch rack systems. Maybe that's another search term you can use.
-
Arduino or Zero Delay Encoder for 3-way switches?
No1sonuk replied to durka-durka's topic in Home Cockpits
Download and install this arduino library in the IDE, then try again: https://github.com/DCSFlightpanels/dcs-bios-arduino-library/releases/tag/0.3.7 -
Maybe try changing the plugs. I'd likely go for something like this https://www.kenable.co.uk/en/networking/power-distribution-units/rack-mount-pdus/7760-kenable-power-distribution-unit-12-way-c13-iec-19-horizontal-pdu-to-c14-plug-007760-5055383477609.html?gclid=Cj0KCQjwtvqVBhCVARIsAFUxcRsfcw4fcPSOxXbgbaGOT9WOGbQGLBQP-W4ZpOepUrsmR-7if22KCJEaApAGEALw_wcB
-
Arduino or Zero Delay Encoder for 3-way switches?
No1sonuk replied to durka-durka's topic in Home Cockpits
The problem is how DCS responds to the "button" inputs. e.g. The A-10C responds to the flap switch on the Warthog throttle in such a way that if one of the two "button" inputs is on, the flaps go all the way up or down, and if both are off, the flaps go to a mid position. But the FC3 F-15 doesn't respond to the centre position. Likewise, when you turn on and off the A-10C APU switch, it turns on and off the APU. I have that switched mapped to the battery switch for the F15. If I turn the switch on, the battery comes on, but turning off does nothing. I turn it on again and the battery goes off. This is why how the aircraft module responds to HID buttons is important for the decision on which type of controller you use. -
Arduino or Zero Delay Encoder for 3-way switches?
No1sonuk replied to durka-durka's topic in Home Cockpits
Not having the F16, I don't know if the 3-way switches will work right as a "joystick". I do know that a lot of those inputs in DCS behave as toggles, so it might not be easy. If you use a Pro Micro or Leonardo in "joystick mode", there IS a way to give them unique identities. I'll track it down later. -
Arduino or Zero Delay Encoder for 3-way switches?
No1sonuk replied to durka-durka's topic in Home Cockpits
I can't see the F-16 controls in DCS as I don't have that module. What I _CAN_ do is give you arduino code for DCS-BIOS: /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" // Change these to the appropriate pin numbers: // LASER ARM Switch, ARM/OFF #define LaserArmPin 2 // MASTER ARM Switch, MASTER ARM/OFF/SIMULATE #define MasterArmPinA 3 #define MasterArmPinB 4 // Autopilot PITCH Switch, ATT HOLD/ A/P OFF/ ALT HOLD #define ApPitchPinA 5 #define ApPitchPinB 6 // Autopilot ROLL Switch, STRG SEL/ATT HOLD/HDG SEL #define ApRollPinA 7 #define ApRollPinB 8 // -------------------- /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos laserArmSw("LASER_ARM_SW", LaserArmPin); DcsBios::Switch3Pos masterArmSw("MASTER_ARM_SW", MasterArmPinA, MasterArmPinB); DcsBios::Switch3Pos apPitchSw("AP_PITCH_SW", ApPitchPinA, ApPitchPinB); DcsBios::Switch3Pos apRollSw("AP_ROLL_SW", ApRollPinA, ApRollPinB); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } That should work in most Arduinos with DCS-BIOS running in DCS. -
Arduino or Zero Delay Encoder for 3-way switches?
No1sonuk replied to durka-durka's topic in Home Cockpits
The Leonardo doesn't NEED DCS-BIOS if you only want it to behave like a joystick. You can just use the Joystick library. I only mentioned DCS-BIOS because you can use it if you want the controls DCS-BIOS offers, and/or the info DCS-BIOS exports.