Jump to content

No1sonuk

Members
  • Posts

    1594
  • Joined

  • Last visited

Everything posted by No1sonuk

  1. 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.
  2. Is there a reason you're writing the encoder code yourself, rather than using the DCS-BIOS rotary encoder function?
  3. Is the bed underneath magnetic? If it is, maybe some magnets would help to stop it shifting.
  4. 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.
  5. Looks to me like the cross is a joystick switch without the self-centring.
  6. 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?
  7. 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.
  8. My solution wouldn't work for those.
  9. @Mr_Burns I used a similar idea for a 5-position P51 fuel tank selector.
  10. 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.
  11. 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.
  12. 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.
  13. You have to make sure to use a PWM-capable output, though.
  14. Try the "Disable hot plug" at the bottom. This prevents DCS rescanning your USB ports automatically.
  15. 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.
  16. 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.
  17. 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.
  18. In trawling for panel Ideas, I found this. It might give you some ideas: null
  19. The blue Dykem is still readily available in the UK as far as I can see. e.g. https://www.amazon.co.uk/Dykem-Steel-Layout-Fluid-Brush/dp/B00BXT3ZWW/ https://waltersandwalters.co.uk/Dykem-Steel-Blue-Layout-Fluid-80600-80400
  20. OK. It might be a sample-and-hold ADC, and the floating inputs aren't wiping out the input voltage from the single pot. You could try connecting the unused inputs to ground. That should eliminate the problem.
  21. I can't see anything wrong with your code for the potentiometers, so that leads me to ask how you've wired them.
  22. If you had it working in a "game controller", why do you want to switch it to DCS-BIOS? I may have an old version of the control ref, but I can't find "PLT_ENG_R_IDLE" in it.
  23. You say you've "tried installing DCSBiosSkunkworks a few times". Were you using the "Hub" version before? If so, your Arduino and F-18 brain will probably need reprogramming.
  24. I'll look at the panel in detail later. VERY interesting idea putting a rotary encoder on a rotary switch knob! BTW, did you know Google Translate can work on web pages? Try this: https://www-cruzdesanandres-com.translate.goog/foro/viewtopic.php?f=10&p=168709&_x_tr_sl=es&_x_tr_tl=en&_x_tr_hl=en-US&_x_tr_pto=wapp#p168709 The only real difference for your case between a Nano and Mega would be pin numbers in the code. The Arduino IDE sorts out the device programming differences. If you were making the whole panel, a Mega might be needed, but for a single control, that's overkill. I asked about the collective because I was hoping you'd say it was a Bodnar BU0836. You could possibly use that with your encoder if there's a bind for the function you want in the DCS controls page for the Huey. That would entirely bypass DCS-BIOS and make the control almost update-proof. Leo Bodnar have a piece of software that you can use to configure the BU0836 to use 2 inputs for an encoder, and set the number of steps per detent to match your encoder. That then adds 2 "virtual buttons" to the BU0836 output to Windows. One virtual button pulses when the rotary is turned one way, the other pulses for the other direction. Those virtual buttons can be bound and used for anything that uses an encoder in any module that has binds available. I don't have the Huey, so I can't see if the controls you want have binds available.
  25. If you can link to the panel you speak of, I might be able to help. My Spanish isn't wonderful, but I do understand the DCS-BIOS code. Also, if all you want is a rotary encoder, a Mega is overkill - a Nano would suffice. And you said you made the collective: What does it use for the interface to the PC?
×
×
  • Create New...