

No1sonuk
Members-
Posts
1601 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by No1sonuk
-
First-off: Try this to get the end values the Arduino sees when it does the A/D conversion: https://www.arduino.cc/en/Tutorial/BuiltInExamples/AnalogReadSerial Then try this: DcsBios::Potentiometer consolesDimmer("CONSOLES_DIMMER", A0, false, min_value, max_value); Yup. Input range mapping was added to the function last year sometime. You'll need to make sure you have the latest Arduino library The "false" means "don't reverse the operation" - change it to "true" if your pot goes the wrong way and you don't want to remap it in-game or rewire it. The function works without those last 3 parameters because defaults are set. The defaults are : false, min_value = 0 , max_value = 1023 The DCS-BIOS code then automatically maps like this for non-reversed: State = map(analogRead(pin), min_value, max_value, 0, 65535); And like this for reversed: State = map(analogRead(pin), min_value, max_value, 65535, 0); You could also do this if you just need to reverse the pot, but not change the min and max: DcsBios::Potentiometer consolesDimmer("CONSOLES_DIMMER", A0, true);
-
PM me please to remind me to write something here when I get home from work.
-
You're using the functions wrong. Try analogRead in a main loop function, then use SendDcsBiosMessage to send the numbers to DCS.
-
Oh. So it's a bug with DCS itself? Report it for bug fixing.
-
Something like this in the Arduino code? unsigned int AltMetres = 0; // Put this at the top with your variable definitions. void onAltMslFtChange(unsigned int newValue) { AltMetres = newValue * 0.3048; // Add code here for what you want to do with the data or use the global variable in your main loop. } DcsBios::IntegerBuffer altMslFtBuffer(0x0434, 0xffff, 0, onAltMslFtChange);
-
I'm using a 3.5" TFT for my mini-CWP, and mine seems to be correct. Have you checked the addresses and masks are correct?
-
Multiply ALT_MSL_FT by 0.3048 to get metres.
-
Have you tried flashing the old bootloader to the new ones? Not sure if it's possible, though.
-
"DcsBios::Switch2Pos" means a switch with two positions - ON-OFF - 0 or 1 goes to DCS. "DcsBios::Switch3Pos" means a switch with three positions - ON-OFF-ON (2 pins required) - 0, 1 or 2 goes to DCS. For this line: DcsBios::Switch2Pos pltMasterCautionReset("PLT_MASTER_CAUTION_RESET", 2); "DcsBios::Switch2Pos" is the setup definition for a two position switch. "pltMasterCautionReset" is the name of the control the arduino code uses - these must be unique in each sketch, but can be pretty much anything you want to call it. "PLT_MASTER_CAUTION_RESET" Is the command sent to DCS with the switch state, as I described earlier. "2" is the arduino pin number of the switch input. "true" is missing from that line because it's not needed - true would make the switch work the other way round - sending "0" when pressed instead of "1". It's defaulted to "false" so you only need to add that parameter if want to invert the output. The control ref is an HTML document in the Scripts\DCS-BIOS\doc\ folder
-
The way DCS and DCS-BIOS are written is what determines how those commands are interpreted. At a bottom level, DCS-BIOS sends "GEAR_LEVER 1" to DCS if the switch is turned on or "GEAR_LEVER 0" if it's turned off. The switch2pos part is code that handles how to interpret the switch operation. When you grab the code lines from the control reference, if the bracketed part is the same as one you already have, you don't need that new line.
-
Yes. Sort of. e.g.: DcsBios::Switch2Pos pltMasterCautionReset("PLT_MASTER_CAUTION_RESET", 2); DcsBios::Switch2Pos masterCautionResetSw("MASTER_CAUTION_RESET_SW", 2); This will reset the Master Caution alarm on the F14 and F18 using one switch on pin 2. It will send both commands, but DCS will just ignore the one not meant for the module you're using. You can stack more, but there are a couple of caveats: 1. The names before the parentheses must be unique. Those names are not fixed in the BIOS, so they can be set by you. If you have two the same, change at least one of them. e.g. masterCautionResetSw and masterCautionResetSw_1 2. The parts in quotes, e.g. "MASTER_CAUTION_RESET_SW" are what DCS responds to and cannot be changed. HOWEVER, if your code lines contain duplicates of this argument, you only need one of those lines - all aircraft that use that name will respond to the one line. e.g. DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // F16 DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // AJS37 DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // A10 DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // F18 Would fail to compile because the names before the parentheses are duplicated. It can be corrected and simplified to this: DcsBios::Switch2Pos gearHandle("GEAR_HANDLE", 3); // F16 and AJS37 DcsBios::Switch2Pos gearLever("GEAR_LEVER", 3); // A10 and F18 Other options, such as Lep Bodnar boards or other HIDs, can be set in DCS.
-
WRT DCS BIOS: Use the "Flight panels Fork", not "Hub". Hub is no longer maintained and is increasingly not working properly as DCS updates. The Flightpanels Fork is actively maintained, despite having a lower version number than Hub. Good setup and start video here:
-
@lesthegrngo Those Arduino coding forums annoy the hell out of me at times. The "superior" attitude of some of the people responding to beginners' questions REALLY annoys me. You go there looking for a solution to a simple problem, and they interrogate you for the full code, then proceed to comment on parts you're not having issues with.
-
They're made by Alpha, But I don't see a part number - it must be underneath.
-
He doesn't want to use a USB port for it - If he did, he'd just use the Mega which he said worked on USB.
-
I just checked - they DO NOT continuously rotate.
-
It's an ordinary rotary switch on a PCB. I'll confirm when I get home from work.
-
@maciekish Sorry, but I can't help with the ins and outs of that code. Maybe try the Flightpanels fork Discord? All I remember is a mention that there were issues with using a Mega as a slave device. I don't remember the details or if there was any resolution. I suppose the easiest option would be to use USB for that device if it works.
-
@maciekish ISTR some people reporting problems with using Megas as RS485 slaves. I assume that's what you're trying to do if you're direct driving the LEDs. That's also possibly not a good idea due to the amount of power you'll be drawing from the Arduino. You say you tried a smaller panel. Was that also with the Mega? Can you try it with an Uno? @lesthegrngo "Bit banging" * should only be a problem if you're using a software serial port. RS485 masters should be Megas because they have multiple hardware serial ports so bit-banging isn't required. Those connect to the hardware serial ports on the slave devices (usually D0 and D1). The only problem then is the combination of data rate, size of the UART buffers and the amount of data processing required. The MAX7219 doesn't increase processor overhead because, as far as I'm aware, the I2C/SPI port is another hardware port specifically for I2C and SPI. * "Bit-banging" is where the program has to turn on and off the output pin in the correct timing to create the serial data stream, or read the input pin at the correct intervals to receive the data. This requires a processor core to only do this task. This is what the code does automatically if you set up a serial port on a pin that isn't connected to a hardware UART. In the case of a hardware serial port, the code writes or reads a single memory location and the processor's hardware deals with the data transmission/reception. This obviously takes virtually no processor time. For this reason, Megas are used as RS485 masters because they have more than one hardware UART available.
-
-
DCS BIOS Moving LST/NFLR moves FLIR switch in game
No1sonuk replied to danos_2503's topic in Home Cockpits
Yes. The Flightpanels fork was built on an older version of DCS-BIOS. The devs maintained and updated the system when the original went silent, and are continuing to do so. -
I can tell you they're not used on Airbus A319, A320 or A321 - I have limited access to manuals for those and their components. ATA 33-12-33 isn't available from my source. It's not available from the Aircorps Library either - The light is too new for that. BTW, no data plate means it was probably determined to be BER/scrap. When that happens, the part number and serial number are destroyed so the unit can't be fitted as certified. One easy way to do this is remove and discard the data plate. I'm guessing the intermittent wiring is the reason it was removed as U/S and "scrapped". Aaand it's possible the mount bracket screws going into the cylinder might hold the internal parts in. I'm not sure, though.
-
Leo Bodnar sell 12-way rotary switches for use with their USB interface boards. I have some tested information for those wondering about how to use them with DCS-BIOS (or any other similar situation). Most questions are asked about the 2-pad BBI-12 switches, but few people realise they make one far easier to use - the SLI-12. The BBI-12 is made for the BBI-32 interface, and is connected between GND and one of the specific inputs on that device. 8 of the inputs have external pull-up resistors so that they can operate as a potential divider in conjunction with the 2-pad switch. The SLI-12 is made for the SLI-Pro interface, and has 3 wires connected like a potentiometer - +5v, GND, and signal. Both are currently priced at GBP5.50 + shipping. Here's a comparison of the two PCBs - the rotary switches themselves are identical. As you can see, the SLI-12 is easy to connect to an Arduino as though it's a potentiometer. The BBI-12 needs a different approach. Rather than use the two pads provided, the BBI-12 can be wired as a potentiometer like this: You can then use the DCS-BIOS analogue multi-way switch code as though it's a potentiometer. e.g. DcsBios::AnalogMultiPos analogMultiPosExample("MSG_0", ANALOG_PIN_A, 12); DCS will ignore the extra positions if, for example, you select position 11 or 12 on a 10-way in-game switch So my advice is this: If you already have a BBI-12, wire it the way shown above. If you don't already have the switch, buy the SLI-12 if you want to use it on an Arduino.
-
An 'important' question, opinions requested!
No1sonuk replied to lesthegrngo's topic in Home Cockpits
I would suggest NOT using that argument with your wife!