Jump to content

No1sonuk

Members
  • Posts

    1601
  • Joined

  • Last visited

Everything posted by No1sonuk

  1. @Dos And @Jimbo Did either of you file an issue case on the DCS-BIOS (Skunkworks/Flightpanels Fork) Github? This thread is the first time I was aware of the problem as I'd only used either Streamdeck OR Arduino, not both together. BTW, I can confirm that a Socat-connected Arduino blocks the Streamdeck. OH, and You should check the port numbers. My Arduino connected to the IDE via Port 4, but needed to use port 5 for the Socat connection.
  2. Yes. 100 nanoFarad. Your code part was blank. This part goes at the top, after the defines: typedef DcsBios::RotaryEncoderT<POLL_EVERY_TIME, DcsBios::FOUR_STEPS_PER_DETENT> FourStepRotaryEncoder; // A custom rotary encoder with four quadrature steps per physical detent. This is then how you'd use it: FourStepRotaryEncoder ilsKhz("ILS_KHZ", "DEC", "INC", PIN_A, PIN_B); // Replace PIN_A, PIN_B as appropriate for your wiring FourStepRotaryEncoder ilsMhz("ILS_MHZ", "DEC", "INC", PIN_A, PIN_B); // Replace PIN_A, PIN_B as appropriate for your wiring Basically, "FourStepRotaryEncoder" replaces "DcsBios::RotaryEncoder" in the code lines.
  3. The four steps encoder thing DOES work. You must have been doing it wrong. As for the other problem: Sometimes rotary encoders need capacitors on them to kill switch bounce. e.g.
  4. WRT the L light coming on - It's directly connected to pin 13 (through a current-limiting resistor), so any +5V input on that pin will turn on the light as well as output. WRT the bus: I'm not sure what you're getting at, but all the A should be connected together and all the Bs connected together, but not A to B except for bus termination. Is your issue not covered here:
  5. Yeah. I can understand using constants for that, but not variables.
  6. SHOULD be the same - primarily because I think the F-14 would have been added to HUB by the Skunkworks guys. There are a few differences, but they're primarily added to the original for backwards-compatability. e.g. Hub doesn't allow adding the "true" parameter to the LED class to make an active-low LED, rather than the default active-high. That was added to the Skunkworks library (which is now available in the Arduino IDE library manager). BTW, the Skunkworks fork has a Discord for support, etc. https://discord.gg/f3P58MHK There's a setup guide here: While the guy annoys me somewhat, and uses some coding techniques that aren't wonderful, the basics are there.
  7. This is most likely your problem. The "HUB" version of DCS-BIOS hasn't been properly maintained for literally years. I wish there was a way to disable that site... You'll need to uninstall that completely and try the "Skunkworks" fork from here: https://github.com/DCS-Skunkworks
  8. Have you tried disconnecting the RS485 transceivers and recoding the slaves for USB? i.e. comment out the RS485 part and put in IRQ SERIAL? It might not be RS485 related at all.
  9. Is there a reason you're writing the encoder code yourself, rather than using the DCS-BIOS rotary encoder function?
  10. Is the bed underneath magnetic? If it is, maybe some magnets would help to stop it shifting.
  11. The first thing to note is 20mA is usually the top end. A lot of LEDs, particularly green ones, will look bright enough with less current. Try some experiments to get the brightness you want with the least current, then go from there. Also, you might want to look into MOSFET drive, rather than hang all those LEDs off an Arduino. And if you go that route, it opens the possibility of a separate supply for the LEDs.
  12. Looks to me like the cross is a joystick switch without the self-centring.
  13. Those hubs usually run on 5V, e.g. from a phone charger. As for the other issue: Have you considered rigging something to press the button a set time after powering on?
  14. There's a "Not for profit" option, which is what I use. There are limitations, but I don't know how it'll affect what you're using it for. I use KiCAD for my schematics, etc. That could work, but might spoil the bottom surface with reflected light burning.
  15. My solution wouldn't work for those.
  16. @Mr_Burns I used a similar idea for a 5-position P51 fuel tank selector.
  17. Remember to put a protective plate underneath if you're cutting. On my 3040 engraver, I use a ceramic block designed for brazing, but that might be too heavy for a 3D printer bed.
  18. Yeah. If sendDcsBiosMessage and tryToSendDcsBiosMessage are disabled, switch inputs to DCS aren't going to work. My limited grasp of the Arduino code indicates that the data parser isn't included when the RS485 Master code is active. If that's the case, the Master can only act as a data router, and not do anything with the data itself. I think the only way we'll know for sure is if someonme tries it. I don't have the setup to do that myself right now.
  19. Reading and keeping track of switches is probably too much extra for the Master to handle. LED outputs are far less demanding of resources, so it might be possible. OTOH, the Master code might have the other functions disabled.
  20. You have to make sure to use a PWM-capable output, though.
  21. Try the "Disable hot plug" at the bottom. This prevents DCS rescanning your USB ports automatically.
  22. Sounds like a galvanometer or a moving coil meter. You can buy them, but they're getting expensive because steppers or digital meters are replacing them.
  23. I only followed about 1/3 of that code. But I guess you just needed to know DCS-BIOS isn't as rigid as most people think.
  24. Most people use encoders and separate displays because it avoids switch synchronisation problems. But, to answer your question: You could try sendDcsBiosMessage. At the end of most of the Arduino controls is a call to sendDcsBiosMessage. What most users don't know is that you can invoke that yourself, and use the existing control reference to get the parameters. The syntax is sendDcsBiosMessage(message, value); Note that they're both strings, so value needs to be, for example, "1", not 1. To do with this original code line meant for an encoder, you can figure out the sendDcsBiosMessage code: DcsBios::RotaryEncoder vhfamFreq2("VHFAM_FREQ2", "DEC", "INC", PIN_A, PIN_B); "VHF_FREQ2" is the message that will be sent to DCS, followed by "DEC" or "INC". However, if you look at some other lines, they have "+3200" or "-3200". "INC" and "DEC" are essentially "+1" and "-1". But what does this mean? You can try this in your own switch-handling code: sendDcsBiosMessage("VHFAM_FREQ2", "0"); That should set the control to the first switch position. You just alter the "0" to whatever position is required. NOTE, though, that it's the switch position, NOT what the switch displays. e.g. The Frequency Selector 4 display values are "00", "25", "50", and "75", but the position values you'd need to send are "0", "1", "2", and "3". HOWEVER... There is another option that MIGHT work better. As implied earlier, DCS-BIOS is far less restrictive than most people know. Although the control reference lays down specific controls for functions, for the most part, these are just what the creators decided were the best fit for those functions. Most people will just use these and have no problems. BUT, others might also work. For example, this MIGHT work: const byte vhfamfreq2Pins[10] = {PIN_0, PIN_1, PIN_2, PIN_3, PIN_4, PIN_5, PIN_6, PIN_7, PIN_8, PIN_9}; DcsBios::SwitchMultiPos vhfamfreq2("VHFAM_FREQ2", vhfamfreq2Pins, 10); This was adapted from the UHF 1MHz frequency selector. That's worth a look as a good example of multiple control types for the type of function you need... Another thing most people don't know about DCS-BIOS is that in this line, for example: DcsBios::RotaryEncoder vhfamFreq2("VHFAM_FREQ2", "DEC", "INC", PIN_A, PIN_B); The green part can be pretty much anything you want, but it MUST be unique in each sketch. This is useful if, for example, you want multiple phyisical devices to alter the same control in DCS. So theoretically, both the 10-way switch AND rotary encoder code lines I shared above could alter the VHF AM freq 2 parameter because vhfamfreq2 is not the same as vhfamFreq2 (upper case "f" on "freq") as far as Arduino code is concerned. Another use could be driving two different pins with the same LED output: DcsBios::LED masterCaution(A_10C_MASTER_CAUTION_AM, PIN); // Original from control reference DcsBios::LED masterCautionA(A_10C_MASTER_CAUTION_AM, PIN_A); // Second one with altered label Both use the same basic function, but won't clash because I altered the label of the second one to make it unique. That may be of no use to you at all, but it's there as an explanation of how I could "make up" the labels for use with the 10-way switch code. That turned out more complex than I originally intended. Let me know if you need any clarification.
  25. In trawling for panel Ideas, I found this. It might give you some ideas: null
×
×
  • Create New...