Jump to content

No1sonuk

Members
  • Posts

    1601
  • Joined

  • Last visited

Everything posted by No1sonuk

  1. I'd definitely go with the Bodnar for the encoders and simple switches. The Bodnar encoder config software also helps with encoders that have more than one pulse per detent, so don't immediately dismiss it. You really only need the arduinos if you want fancy switch functions such as originally discussed - i.e. 3 different outputs for 2 inputs. If you don't need an output for the centre off, you can also use the Bodnar.
  2. You could theoretically run an 8x8 diode-blocked matrix on a Leonardo. Then the HID part is taken care of by default.
  3. Ah, but that image looks like it has the right USB chip - the second 2x3 pin header near the USB and small square chip are the indicators. That's a 16u2. Did you try this video: It looks simple enough to me. There's something there about installing and using a special library in the IDE as well.
  4. Which EXACT Mega do you have? A photo would help. "Compatible" Unos and Megas don't always have the right USB interface device to be able to reflash the firmware.
  5. That doesn't change the overlay polarity.
  6. Is there a USB joystick test app that supports more than 32 buttons? I've been using Pointy's joystick test app until recently, but it has stopped working.
  7. No Idea. I've not tried it.
  8. I just read that the joystick library doesn't work with the Mega - I think it has the wrong processor.
  9. 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.
  10. 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.
  11. Try before the flight start, not restart DCS.
  12. 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.
  13. Which version of DCS-BIOS? Which aircraft? Which functions?
  14. I've asked the question, and linked this thread, in the Discord channel.
  15. 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.
  16. 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?
  17. I export STEP files from KiCAD to import into F360. If Solidworks can't take SETP, I suggest trying something else.
  18. 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.
  19. 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.
  20. 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.
  21. 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
  22. IIRC, Arduino megas have something like 50 IO.
  23. Don't know if there will be for Hub. There is already one for the Flightpanels fork.
  24. 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.
  25. 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.
×
×
  • Create New...