Jump to content

Recommended Posts

Posted (edited)

http://www.it-eam.co.uk/boltz

 

What is A2DCS?

A2DCS is freeware designed to allow you to use Arduino (http://www.arduino.cc/) controllers to communicate between hardware such as switches, LEDs, rotary encoders, 7-segment displays and the flight simulator DCS World (http://www.digitalcombatsimulator.com/en/world/) by Eagle Dynamics. It allows you to build anything from a few simple push switches to a full-blown home cockpit.

 

Why was A2DCS developed?

A2DCS was developed because I am building a full A-10C home cockpit and required a method to control the input and output from DCS World to my hardware. I decided to use Arduinos due to the flexibility they provided and the fact that they are relatively cheap when compared with other methods.

 

What aircraft does A2DCS work with?

Currently A2DCS only works with the A-10C module of DCS world but more aircraft may be added in the future.

 

How does A2DCS work?

A2DCS can be used in two different ways. Firstly it can be run on the same computer that is running DCS World or it can be run on a separate computer by TCP over a LAN connection. The latter option allows you reserve your main computer for DCS World to get the highest performance out of it.

You wire electrical components to an Arduino which is connected to a computer running A2DCS. It can then read and write on certain ports to manipulate the simulator and your hardware.

 

Will A2DCS work alongside other programs?

A2DCS has been tested alongside Helios (http://www.gadrocsworkshop.com/) and iControl DCS (http://bit-shift.com/icontroldcs/index.html) and it may work with other 3rd party software but has not been tested.

 

Downloads before moving to website:

Setup instructions - 372

x64 Versions - 187

x86 Versions - 69

Fix Version - 41

 

Boltz

Edited by Boltz
  • Replies 129
  • Created
  • Last Reply

Top Posters In This Topic

Posted

Hi Aginor. Yes it works both ways with no problems. I currently have a working UFC, AHCP, Fuel, Fuel Select and HARS Fast Erect panel working for input along with a nice flashing master caution :) I might make a video this weekend to show it working. A caution panel is awaiting testing working from shift registers.

 

A2DCS uses a serial connection and a custom communication standard which will be explained in more depth soon.

 

I am currently using A2DCS on an Arduino Uno and 2 Megas. There is no limit in numbers from the software point of view but there may be a limit in how many can be connected before the drivers start causing interference. Technically it should work on any Arduino board due to the initialisation built in. Rather than input and output pins being defined in the sketch they are defined in a config file and sent to the Arduino on start up of the program leaving the Arduino as a "dumb" controller.

Posted

Could it work with BS1 ?

---------------------------------------------------------

PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor

Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe

Posted

I only own the A-10C module but because it is DCS World that exports and not the individual modules then I see no reason why it shouldn't. I would just need to get Device, Event and Argument IDs. Some can be found in the DCS install path but I can't find all of them for the A10 so I have to press the switches in game and then follow the sequence in the generated log file. I could easily work through other aircraft in the same way so I will probably pick up a few more modules including BS.

 

I don't know much about BS but I'm interested in why you are using BS1 and not upgrading to BS2 from http://www.digitalcombatsimulator.com/en/downloads/modules/dcs_black_shark_2_upgrade/?

Posted

Ok, sounds good. I asked because I tried to implement Gadroc's EOS on my Mega2560 a while ago but couldn't get it to run. I'm not new to programming (it's my job actually), but rather new to Arduino, and unfortunately I didn't have the time yet to get into it more deeply.

As for serial connection or USB: I tried the USB HID way like overpro did in this thread: http://forums.eagle.ru/showthread.php?t=117011&page=4

but until now I failed. USB is nice because of "Plug&Play", and because you can use the input stuff in other games as well, since the OS handles it. But it also creates quite a bit of an overhead. Did you just choose serial because it is supposed to be easier (you don't have to mess around with USB), or are there other reasons as well?

 

My goal is to build a UFC like you did, and then if that works maybe I'll do some more. Also I'll learn to use my Arduino which is also nice. :)

 

EDIT: Maybe Extranajero is still on BS1 because of his hardware. DCSW needs more power from the hardware than BS1. Just guessing.

Posted

The reason I use the serial connection is actually from when I flew FSX and my original cockpit. In FSX you could not map all the functions to joystick controllers but rather had to use simconnect protocol.

 

Overpro did a great job but it only provides input in DCS you have to use the export.lua to read ouputs so it made sense for me to continue using the serial connection so I can have IO on the same board.

 

A2DCS is only deigned to work with DCS at the moment as it is mainly focused at those of us building cockpits for a certain plane, I can also merge in the SimConnect code if people would like it working with FSX.

 

It does have keyboard emulation built in so you can map keyboard commands to switches, potentiometers and rotary encoders and that can happily type in notepad but it seems that DCSW needs individual controllers specified rather than just a generic "Esc" key press. I suspect that other high-end games would be the same and therefore you would need some sort of HID device for input. With overpro's permission I might be able to merge the code so that you can toggle in software whether it is serial connection (input and output for DCSW and FSX) or an HID device (input only for other games.) There are endless possibilities.

 

All I need to know are what games people want it in and how input works in them. Output usually involves a different solution for every game so would take much longer to get working but it's still doable for a few games.

Posted

 

EDIT: Maybe Extranajero is still on BS1 because of his hardware. DCSW needs more power from the hardware than BS1. Just guessing.

 

That's right. I had the choice of spending my spare cash on starting to build a pit, or on a new PC.

 

Is this 'export.lua' file the first thing I should be looking for in BS1 ?

 

I'd like to help if I can, I'm no programmer but if it's a case of finding bits of data in text files or whatever I can manage that no problem.

---------------------------------------------------------

PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor

Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe

Posted

I do remember now that someone recommended to a few people that they should use the A-10C standalone with older hardware. I also had the choice of starting a pit or a new PC but I went with the pit and currently my PC can just cope with 1 screen but that's getting a bit rough.

 

First I would recommend that you search the program directory and your Saved Games folder for "export.lua". If you don't find anything then you can try using Helios to create one.

 

A part of the manual from A2DCS version 1 is attached below. It covers how to create an export.lua using Helios.

Creating export lua.pdf

Posted (edited)

OK thanks. I ran Helios and found out that for BS1 users the export.lua file is created in " your base directory\config\export "

 

I have deleted the rest of this post because it was a bunch of stupid questions, the answers to which I found out myself :D

Edited by Extranajero
Because I'm an idiot

---------------------------------------------------------

PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor

Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe

Posted

Cheers Hans for the kind words. Currently trying to upgrade to v1.2.7 but my PC has messed up the Blu-Ray backup disk I was trying to use for a backup. I'll see what happens next with that.

 

Extranajero, no questions are stupid. I don't know how BS1 exports info but I'd be interested to know. Good news is that the export.lua sounds like exactly what I was looking for but you would need to see if it is actually run. I believe Helios does work with BS1 so it should run but just to check, edit the export.lua to add the following line of code at the end.

print("export.lua initialised.\n")

Run a mission, un-pause and then exit the mission.

 

Now you will have to find the dcs.log file. For me it's in User/Saved Games/DCS/Logs so I'm not sure where it will be for you. Try looking in your base directory for a Logs folder or if you have a Saved Games folder have a look in there. You are looking for a .log file with abut 3 columns. The first will be dates and times and the others will be what was written to the log.

 

Try doing a search in the document for export.lua initialised. If it's there then that means that the export.lua was compiled, ran and reached the end without any problems. If that is successful then A2DCS will work fine with BS1.

 

I see you deleted your post but for the outputs you will be looking for a file called clickabledata.lua. It looks like a lot but that is every thing that can be exported. Search through it and check if everything you want to export is there. If it is then you have all the numbers you require to export everything to Arduinos.

 

You will simply have to search for the output number in clickabledata.lua and then define it in the config.xml file that all the A2DCS configuration is in. I will upload a spreadsheet with all these in that generates the code for you. It will work for BS1 as well :) Input may be more difficult because I don't have event or device IDs for the BS but I will tell you how t manually find them which is what I have had to do for the A-10C.

 

For a time frame, I'm continuing with testing today and will be testing shift registers and potentiometers tomorrow. It looks like a release will be here tomorrow but I need to finish the instructions. It is now more user friendly to set-up so you will not have to do any lua modification. It will be added into the "3rd party scripts" section of Helios.

 

Boltz

Posted

Thanks again Boltz.

I'm a little wary of injecting stuff that isn't strictly relevant on your thread, so I deleted most of my last post for that reason.

I'll go through the procedure you describe a little later, I had some problems getting Helios working but it's running OK now thanks to a good YouTube tutorial.

 

My Arduino and other pit building gadgetry will hopefully arrive here before too long, it's currently in France travelling overland to Spain and I think it might have stopped off for a little vin rouge and cheese :D

Then I can hopefully become a crash test dummy for A2DCS with BS-1 ;)

---------------------------------------------------------

PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor

Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe

Posted

Don't worry about asking anything not directly associated with this thread. It's here for the program and how it works. If you managed to get Helios to work with a working instrument or something then there is no need to follow my procedure. I just needed to know that the file would be run but it has to be for Helios to work.

 

1.2.7 just installed so I'm back to that and writing the instructions :)

Posted

Hi Aginor. At the moment I'm not using a matrix for the inputs but simply connecting a switch between a digital pin and a ground pin. It seems though that this will take up a lot of Arduinos in a pit (300 digital inputs) so I am already looking at changing to a matrix. Again that is from my FSX days when I saw other people's examples doing it this way and I've always done it like that but a matrix design will come soon :)

Posted

Will there be any issues with using toggle switches as opposed to momentary PB's ?

---------------------------------------------------------

PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor

Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe

Posted

No problems at all as most of the switches in my pit are toggles. The Arduino sketch only outputs state changes so toggles will act just like a momentary push switch would. Push switches require a push and a release command as well so actually DCS treats push switches like toggle switches.

 

Having problems now with my prototype caution panel. On breadboard it works fine but when built on protoboard I'm just getting a display of lights! Could be nice if I was creating disco lights but if my caution panel was doing it in a plane then I would be ejecting quickly :)

Posted

That's good to know ( about the switches, not your panel problem )

 

I checked out the clickabledata.lua for BS1 and it's got everything I need. More than I need actually, I'm only going with the stuff used for flying, navigating and fighting.

Basically just kick the tyres and light the fires :D

---------------------------------------------------------

PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor

Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe

Posted

Hi Boltz,

 

Just let you know for an easy matrix board

http://dx.com/p/diy-mcu-extension-4-x-4-16-key-matrix-keyboard-module-green-151644#.UvhdMGePJBE

 

And for Leds you can modify something like this.

http://dx.com/p/diy-max7219-dot-matrix-display-module-for-arduino-green-151840#.UvhgfmePKQE

So you get 8 * 8 (64 leds), and you only needs 5 pins.

 

I'm looking for an arduino solution ...

Thanks for sharing with us !

 

SilverFox

Posted

The only thing that is even better than a matrix is a shift-register (I think it's called like that in English, not sure).

But matrix allows you to do huge keyboards with one Mega2560. Something in the region of 400keys and you would still have pins left.

And it's not hard to do for the Arduino sketch. I'm new to electronics stuff and I could make it work fairly easy. And you can do the same with outputs. Need 100 LEDs? no problem, works the same way.

That's the reason why I chose the Mega2560 in the first place. Lots of pins and you can even do PWM on 15 of them. Do you use PWM for LED brightness btw?

 

I would love to see your Arduino sketch code snippet for the hardware input/output side (handling key presses and lighting LEDs), and maybe contribute something to make using matrices easier if I can.

Posted

Hi guys! Warning panel wasn't a success there was something wrong in my circuit when I moved from breadboard to protoboard. I now have a batch of PCBs on the way and will solder them up when they arrive.

 

Currently all my LEDs except Master Caution are running through shift registers so a caution panel of 48 LED outputs only takes 3 pins so output is sorted, it just needs to be tested with DCS World.

 

For the input I will convert to using a matrix as it will mean less Arduinos and keep the setup cheaper. For LED brightness I will be using PWM as it's the only way to create decent results easily. Caution panel doesn't require them it would mainly be for backlighting for which I will probably use an external circuit connected to a pot.

 

Thanks Silverfox for linking those items. An input matrix circuit is easy to setup but that LED matrix looks interesting as it would require less soldering to set up. I'm away at the moment and don't have code to post up but switches without matrices and LEDs are done and implemented perfectly in my cockpit.

  • 2 weeks later...
Posted

Just a small update to say that this project is still going. PCBs arrived and are waiting to be soldered so I have been working on other aspects of the programming although I got a prototype of 74HC595s on breadboard working and lighting a caution panel. The code for them to drive 7 segment displays is also in place and just needs to be tested.

 

Input matrices are now done and I have begun to redesign the wiring of my pit to take advantage of that idea. My UFC will remain as simple switches so you will have the possibility to do either where ever you want in your pit. Potentiometers have also been completed along with the mapping and adjustable curvatures for them to work.

 

Due to the increase in functionality I am now reworking the communication format as well to add all these new features and more to come.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...