Jump to content

Hansolo

Members
  • Posts

    1775
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Hansolo

  1. Alright. First off all your sketch works, I just tested communication on my machine running your code /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos lightsTestSw("LIGHTS_TEST_SW", 22); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I only have the A-10C and it doesn't looks like it's for that airframe which means I can't test functionality of the switch. What aircraft is the code for by the way? In it's 'raw' state DCS-BIOS is specific to one airframe, which means that if you load the code on the Arduino for the F-14B then nothing happens in the A-10C. However the communication should still work as I'll illustrate below. I am a little puzzled as to why you get as mine says 1 [main]. But unfortunately I am unable to tell you what that means simply because I don't know. Anyway please check that you OB saved games folder/DCS.openbeta/script looks at least like this; You may have other stuff in there. I do but removed it for the purpose of this picture. Also check if you get the waterfall of text when DCS is running; If you do then you have communications from DCS to the connect-serial-port program :thumbup: If you do not get the waterfall of text then your export.lua may be missing this line; dofile(lfs.writedir()..[[scriptsDCS-BIOSBIOS.lua]]) Next without DCS running or DCS paused you try and flip the switch to get a result similar to this; If you do get the text lines changing when you flip the switch then the communication between the Arduino and connect-serial-port program is working :thumbup: If you do not get similar result then check your wiring on your switch. If it is has three pins for a two position switch then you may have used the incorrect ones. A multimeter set for Ohms can quickly rule this out. Also confirm that you are using GND and pin22 similar to this All the used pins are being pulled high in DCS-BIOS. You ground the pin to trigger the input. One way to check communication from DCS via onnect-serial-port program to the Arduino is to modify your code to include Pin13 as an LED e.g. DcsBios::LED masterCaution(0x1012, 0x0800, 13); // NOTE THIS IS FOR THE A-10C!! This won't work for you as it looks like your code is not for the A-10C, however you get the idea as to use the onboard LED to check communication from DCS via connect-serial-port program to the Arduino. You just need to find the code string for your particular airframe. With regard to the Baud rate I heard this recently also in another post. I am pretty sure you can't change the Baud rate for the Arduino using DCS-BIOS. It's default set to 250000, but granted I can be mistaken. I haven't modified my BIOSConfig.lua file so don't think you need to either. I normally start connect-serial-port program prior to starting DCS but I don't think that should matter at all. Cheers Hans
  2. Could you please show us which sketch you have loaded unto the Mega. Thanks Cheers Hans
  3. Good progress. Looking good. Cheers Hans
  4. Welcome sir og that is a very good looking panel. Mind you now you are hooked and doomed ???? Looking forward to more progress on your pit. Cheers Hans
  5. Is it Sting's Anti-G Combat Edge System you are referring to; http://www.viperpits.org/smf/index.php?topic=9750.0 Cheers Hans
  6. Hi Bad CrC, Looks like you can. If you take a look at the Control Reference for DCS-BIOS MI-8MT then under Cockpit Air, View Advanced you'll find this status of the fans; DcsBios::LED cpitAirLFan(0x263e, 0x0080, PIN); DcsBios::LED cpitAirRFan(0x263e, 0x0100, PIN); Mind you I don't have the MI-8 so I am guessing its the right ones :cry: Alright then all you need is an Arduino board. You can use a Nano for this but any other will do. Then since I guess you run 110VAC (US) or 230VAC for the fan you need a relay to separate the low voltage side (Arduino) for the net side. For this particular application you can find 2 channels relay boards on Ebay, e.g.; https://www.ebay.com/itm/5V-1-2-4-6-8-16-Channel-Relay-Board-Module-Optocoupler-LED-for-Arduino-ARM-AVR/282620321470?hash=item41cd7bdebe:m:mxtrkZ4cKALb6TZlfjnZ54w Cheers Hans
  7. Baud rate?? Which version of DCS-BIOS are you running? IIRCC you could only change the Baud rate on the first versions of DCS-BIOS, but can be mistanken. Cheers Hans
  8. Hi hog_driver111th, Take a look at the schematic done by TigersharkBS; https://forums.eagle.ru/showpost.php?p=2376563&postcount=10 It is for tha caution panel for the A-10C but should give you an idea of how to wire the LED as individual instead of 7-segments as described in the datasheet; https://datasheets.maximintegrated.com/en/ds/MAX7219-MAX7221.pdf I am pretty sure I followed this when setting up mine but I seem to recall it's the same layout as TigersharkBS https://forums.eagle.ru/showpost.php?p=2778877&postcount=10 The board though looks similar to yours Cheers Hans
  9. Mr_Burns, I got these. A little more expensive but at 45° switching angle: https://www.mouser.dk/ProductDetail/CK/A12515RNZQ?qs=oIfnSaRkEUkirBC46HgIdA%3D%3D Cheers Hans
  10. Hi Muts, I haven't been running Steam version for years but from your description it sound like; 1. You have connection to Arduino Mega via connect-serial-port as the commands show up when you flip the switch. 2. You also have connection to DCS as you get the waterfall of communication lines once DCS is running. Are you sure that you have used the correct command reference for the air frame you fly? E.g. landing gear in the A-10C is DcsBios::Switch2Pos gearLever("GEAR_LEVER", PIN); Whereas in the F-14B it's; DcsBios::Switch2Pos pltGearLever("PLT_GEAR_LEVER", PIN); As you can see the text is different, thus if you fly for a different air frame than what you have set in the Arduino cde it won't work. Sorry not much help. Cheers Hans
  11. Good catch on the caution panel and awesome work in reverse engineering it Calum :thumbup: Very good to have you back in pit building again. You have been missed sir. Looking forward for more progress (time permitting). Chers Hans
  12. No your forward voltage and the current depends on your Rset. Or in other words you use the Rset value which suits your LED's. Check post #14 by Vinc_Vega Cheers Hans
  13. I believe Ian stated somewhere long time back that he recommended flight controls through HID/joystick controllers as DCS-BIOS may not be fast enought. Secondly when using analog inputs on Arduino's you may have to do some filtering of the input as the communication otherwise get flooded. If you run a single Arduino over USB then this probably isn't an issue, but if you run multiple over RS485 you risk delay in other signals if you flood the communication. I also had flooding occur on Helios back when I used this so it's not a culprit of DCS-BIOS. It may also have been hardware (potentiometer) related at that time but I had (with Helios) up to 10 sec delay on switches when running potentiometers. Cheers Hans
  14. Ah ups. Misread the question. Sorry. Disregard above. Works only for CDU Cheers Hans
  15. Disregard. Didn't read the question properly
  16. Hi les, The text is not clearly visible. There is a screen on top of the indicators so you can barely see the text until lid. This is a simulation panel running with original 28V bulbs so whether the color is actually blue'ish in the real jet I can't say. Cheers Hans
  17. Mr_Burns, the easiest way of determining if your connect-serial-port communications works, is to: 1. Load the sketch to your Arduino 2. Start connect-serial-port and use the same COM port number as you used for loading sketch unto the Arduino. 3. Flip a toggle switch and you should get the text lines showing up in the connect-serial-port window. Similar to this; You don't need DCS to check this part out as the Arduino is sending the signals back to the PC via connect-serial-port. Cheers Hans
  18. Try and use pin 13 as output only. If you really need pin 13 as input you may need to desolder the onboard LED. Otherwise it won't register the change. Cheers Hans
  19. You have not connected your switches and LED to the pin numbers you have designated in the code. Connect the red wire for the LED to pin 13. Then rearrange the switches to e.g. 10-11-12. When using the analog pins for digital input you can just use designation A0-A5. A6-A7 on the Nano only works as analog inputs. Cheers Hans
  20. Ah my bad. Sorry for the trouble. Looks like Baldawg has a good idea though. Cheers Hans
  21. If you get an Arduino Nano you may be able to solve with this; /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" /* paste code snippets from the reference documentation here */ const int ejectionPin = 5; // the pin you have added ejection handle int buttonState = 0; // current state of the switch int lastButtonState = 0; // previous state of the switch void setup() { DcsBios::setup(); pinMode(ejectionPin, INPUT_PULLUP); //sets pin no 5 as input with internal pullup } void loop() { buttonState = digitalRead(ejectionPin); if (buttonState != lastButtonState) { // if ejectionPin state is different from last time then check if handle has been pulled if (buttonState == LOW) { //handle has been pulled sendDcsBiosMessage("EJECTION_HANDLE_SW", "1"); delay(10); sendDcsBiosMessage("EJECTION_HANDLE_SW", "1"); delay(10); sendDcsBiosMessage("EJECTION_HANDLE_SW", "1"); } else { // handle has not been pulled // don't do anything. } // Delay a little bit to avoid bouncing delay(50); } // save the current state as the last state, for next time through the loop lastButtonState = buttonState; } Code works after correction Cheers Hans
  22. DCS-BIOS is a piece of software which allows you to interact with DCS via an Arduino controller. It make you able to flip a switch in DCS via a real switch similar to how you do with your Leo Bodnar card, with the exemption that you have to apply the code to the Arduino controller yourself. This is a turtorial done by Ian (farther of DCS-BIOS); For latest download please see here; https://forums.eagle.ru/showthread.php?t=141096&page=7 As you can see you are guided along the way for adding the code. Granted you ay also make something a lot more difficult such as an LCD showing TACAN channels, or driving a gauge using stepper motors. Cheers Hans
  23. Very nice progess. looking good sir :thumbup: Cheers Hans
  24. Nice writeup @rocketeer Cheers Hans
×
×
  • Create New...