

No1sonuk
Members-
Posts
1594 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by No1sonuk
-
I just read that the joystick library doesn't work with the Mega - I think it has the wrong processor.
-
As Raisuli said, download the Arduino IDE, then install the joystick library into the IDE. I use this one: https://registry.platformio.org/libraries/mheironimus/Joystick The #include <Joystick.h> line then tells the IDE compiler to use that library. How many switches are you intending on using? If it's a lot, you might want to mix in Raisuli's 2D array code.
-
You should probably add previous state comparison to that to avoid glitching. And I'd use Switch/Case to keep it simple: #include <Joystick.h> // Create Joystick Joystick_ Joystick; #define SwitchNamePin1 2 // Switch input pins #define SwitchNamePin2 3 int SwitchNameStat = 0; // Current state of switch int SwitchNamePrev = 5; // Previous state of switch // Previous state intialised with an impossible number so that the state code will run at reset. int SwitchNameButtons[3] = {31,30,29}; // Buttons to 'press' depending on the switch position // Button numbers here are button number-1. i.e. 0 here is 1 to computer void setup() { pinMode(SwitchNamePin1,INPUT_PULLUP); pinMode(SwitchNamePin2,INPUT_PULLUP); // Initialize Joystick Library in manual send mode to avoid glitching Joystick.begin(false); } void loop() { //Read the two inputs and make them into a single number SwitchNameStat = digitalRead(SwitchNamePin1) + digitalRead(SwitchNamePin2)*2; //Compare the new number with the old if (SwitchNameStat != SwitchNamePrev){ // Do this if they're different switch(SwitchNameStat) { case 0b00000001: // UP Joystick.setButton(SwitchNameButtons[0], 1); Joystick.setButton(SwitchNameButtons[1], 0); Joystick.setButton(SwitchNameButtons[2], 0); break; case 0b00000010: // Down Joystick.setButton(SwitchNameButtons[0], 0); Joystick.setButton(SwitchNameButtons[1], 0); Joystick.setButton(SwitchNameButtons[2], 1); break; default: // Middle or disconnected Joystick.setButton(SwitchNameButtons[0], 0); Joystick.setButton(SwitchNameButtons[1], 1); Joystick.setButton(SwitchNameButtons[2], 0); } // Set previous state to current state for next loop SwitchNamePrev = SwitchNameStat; } // Everything else for the loop goes here // Finally, send joystick state Joystick.sendState(); } This works on a Leonardo.
-
Try before the flight start, not restart DCS.
-
Is there a way to change the TGP symbology from white to black? It's getting lost against the background, and when I worked on military thermal imagers, there was an overlay polarity change option for that situation.
-
Which version of DCS-BIOS? Which aircraft? Which functions?
-
I've asked the question, and linked this thread, in the Discord channel.
-
There's apparently a bug with that and it's currently only available through the Chrome app. I'm not sure when it'll be fixed.
-
Syria and Caucasus are in the East longitude scale, between 30 and 50 degrees East. The Marianas are over near 139 East. Maybe the numbers are too big?
-
ExpressPCB advice sought for non rectangular boards
No1sonuk replied to lesthegrngo's topic in Home Cockpits
I export STEP files from KiCAD to import into F360. If Solidworks can't take SETP, I suggest trying something else. -
ExpressPCB advice sought for non rectangular boards
No1sonuk replied to lesthegrngo's topic in Home Cockpits
One of the things I really like about KiCAD is that if you set up the 3D models of components, you can export a 3D model of the board and send that back to your CAD program. -
ExpressPCB advice sought for non rectangular boards
No1sonuk replied to lesthegrngo's topic in Home Cockpits
I use KiCAD and Fusion360 myself. I export the board shape as a DXF and import that into the KiCAD PCB design tool as the board outline layer. If I need specific component placement (like for switches, etc.) I include markers in the DXF that can be removed. I'll be doing an MFCD myself soon, and I plan to import the DXF to the outline and another layer, then separate the markers and board outline. -
Nothing happens when the button is pressed. It was a test - I'm going to put the display on an arduino-driven LCD, as the update rate plays havoc with the stream deck display. Also, as I don't know if there's global variable support, the calculations involved have to be repeated for each displayed number. As for reading punch cards, etc. I knew a guy about 20 years ago who COULD read paper tape like it was normal print on a page.
-
That sooooo last year. My latest DCS-BIOS "messing about" was Master Caution light/button on my Stream Deck, and a fuel duration/range estimator ON a Stream Deck button. BTW, I'd advise you to use the "Flightpanels Fork" of DCS-BIOS - it's actively updated and bug-fixed. The Hub version isn't as far as I'm aware. https://github.com/DCSFlightpanels
-
IIRC, Arduino megas have something like 50 IO.
-
Don't know if there will be for Hub. There is already one for the Flightpanels fork.
-
Yes. Helios generates the graphics for the gauges. Viewports come from the game engine. I think the DED might be a viewport. An alternative option is build a physical display with an LCD and drive it with DCS-BIOS.
-
You CAN combine modules in the same Arduino, if that's what you're asking. I've done some experiments with using the same switches and LEDs with different aircraft. For LEDs, you can call the same "onChange" function from different aircraft lines, like this: #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #define mcLEDpin 13 // Common light function void onMasterCautionChange(unsigned int newValue) { if (newValue > 0) { digitalWrite (mcLEDpin, HIGH); // Turn on LED } else { digitalWrite (mcLEDpin, LOW); // Turn off LED } } // A-10 call DcsBios::IntegerBuffer masterCautionBuffer(0x1012, 0x0800, 11, onMasterCautionChange); // F-16 call DcsBios::IntegerBuffer lightMasterCautionBuffer(0x4476, 0x0080, 7, onMasterCautionChange); // P-51 landing gear red light DcsBios::IntegerBuffer landingGearRedBuffer(0x500e, 0x4000, 14, onMasterCautionChange); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I tested that code in a Nano. On the P-51, pressing the Unsafe Landing Gear Light Test on the clickable cockpit turned on the LED. In the same DCS session, with no reset of the Arduino, the LED responded to the A-10 Master Caution light. I don't have the F-16 or F-18, so can't test those, but having the code in there didn't affect anything. You'd obviously need to check for address conflicts, and I may be missing some other issues, but that works for LEDs. After that worked, wondered if it works for switches as well, so I added this to the code above: #define mcSWpin 2 // Added at top of code DcsBios::Switch2Pos ufcMasterCaution("UFC_MASTER_CAUTION", mcSWpin); // A-10 Master Caution Switch DcsBios::Switch2Pos unsafeLndGearLtTest("UNSAFE_LND_GEAR_LT_TEST", mcSWpin); // P-51 landing gear red light test switch And now, a single switch on the Nano either activates the P-51 unsafe gear light test or the A-10 Master Caution reset depending on which aircraft you're using. Again, same caveat that there's no conflicts in these functions, but there might be in others.
-
Stepper motor drivers for use with Arduino and DCS Bios
No1sonuk replied to lesthegrngo's topic in Home Cockpits
Do you guys remember when I said this: I wasn't kidding about the bug. I asked the guys that maintain the FlightPanels fork of DCS-BIOS, and they couldn't figure out why the gauge reads differently. -
You can do this for gauges. I just tried it with one of the A-10C fuel flow gauges. What I did was set up the extra monitor in the Helios profile, but EXCLUDED it from the setup in DCS. i.e Helios knows it's there, but DCS doesn't. The result is a gauge running over whatever is on the monitor behind. I think this will work as long as you don't want viewports on the extra monitor. IIRC, DCS blanks the whole area in its setup resolution. If you want DCS exported viewports, you might be able to include a portion of the extra monitor in the DCS resolution. I've not tried that.
-
Hi, Sent this by email on Wednesday evening - no response seen yet. Did you solve the issue described here: https://play.google.com/store/apps/details?id=com.dcsufc&hl=en_GB&gl=US&reviewId=gp%3AAOqpTOHetcL0XKatTsilDmXH2CujhVuQiRG50WFKKmsdRgyXy5Wwjq4JVCk1-pk4ElLZqA1JP9_BqKbfOHqDk9A I'm having the same problem. Specifically with the A-10 CDU, etc. I'm trying it on a cheap Tablet and my Samsung A71 phone. Same result on both. It initially shows the CDU data and switch positions, but then if you move away from the CDU, then back, it's all gone. No display, default switch positions, and the in-game unit responds to the buttons on the device app. I'm using DCS Open Beta if that's relevant. Thanks
-
Stepper motor drivers for use with Arduino and DCS Bios
No1sonuk replied to lesthegrngo's topic in Home Cockpits
I gave up on the P-51 airspeed indicator. There's a bug which means the number output doesn't relate directly to the angle of the needle. This means that if your gauge face is marked as in the game, the reading doesn't match your airspeed. -
New to DCS-Bios and Arduino Won't connect to Virtual Cockpit
No1sonuk replied to supa325's topic in Home Cockpits
From the description, it is Hub. I second switching to flight panels before you start. -
Universal military aircraft homecockpit project
No1sonuk replied to Viper1970's topic in Home Cockpits
Thanks. That works well, and the CDU is the main reason I wanted a tablet option - the tablet and app cost less than it would cost me to build a physical CDU. -
Universal military aircraft homecockpit project
No1sonuk replied to Viper1970's topic in Home Cockpits
I spoke too soon... Just received a new tablet and tried it. With the two A-10 MFD viewports I had literally MINUTES of lag. I'll try again after a reboot later.