mr.john_doe Posted May 27, 2014 Posted May 27, 2014 Thank you. Is it possible to use other arduinos as the mega? Can I use my nano? Greetings
Boltz Posted May 27, 2014 Author Posted May 27, 2014 Thank you. Is it possible to use other arduinos as the mega? Can I use my nano? Greetings I have tested an Uno and I see no reason why a Nano will not work. Just upload the same sketch and test it. I am interested to know if it works on other Arduinos as well as Mega and Uno. A-10C Cockpit Build Thread My YouTube Channel
Stevos758 Posted May 27, 2014 Posted May 27, 2014 AS soon as I get some free time I really want to try this! This looks awesome! Ill have the whole room blinking! Facebook Ripp's Garage Tech LLC
mr.john_doe Posted June 1, 2014 Posted June 1, 2014 For the Master Caution Push and other UFC commands you can find them in the "config.xml". Take a look through there and it should make some sense, I hope. As for the LEDs I only have the Master Caution in use at the moment but Devon Custard recently posted all the exports on the wiki (http://deadfrogstudios.com/warthogpit/index.php?title=Reference_Data.) If you use the Caution Panel, MIP Annunciators and others which are only on and off then you will be able to get them running now. In the config.xml just copy the master caution line and change the pin number and "404" to a new value. Radios and other exports will require additional components to display them. When I have some time I will look at the radio exporting next but be prepared to create some circuits :smartass: Hello, my question means who has defined those actionnames? Came them from you coded in your program or are they standard terms from helios. So if there are not hard coded in your exe we can add new commands for new panels maybe. I have searched the helios wiki but couldn't find the commands. Greetings
Boltz Posted June 1, 2014 Author Posted June 1, 2014 The actions names are references deep in DCS. They have nothing to do with Helios and there is no way to change them. DCS will export those names and values. You just have to specify which ones you want to listen to. I hope that explains it a bit clearer. Boltz A-10C Cockpit Build Thread My YouTube Channel
mr.john_doe Posted June 1, 2014 Posted June 1, 2014 OK, do I have that understand right? They are for both, inout and output? So is there a reference where I can search those terms?
Boltz Posted June 1, 2014 Author Posted June 1, 2014 They are different for input and output but all are hard coded into DCS. They can be found in various files but there is no single place unfortunately. I will upload more when I have the time to find them. 1 A-10C Cockpit Build Thread My YouTube Channel
Duckling Posted June 3, 2014 Posted June 3, 2014 Great work Boltz ! Thanks. Have to find a slot to try it out Cheers Gus - - - -
Boltz Posted June 3, 2014 Author Posted June 3, 2014 Thank you everyone for your kind words! Please let me know when you get it working. It would be great to know that it is actually working for you all. 1 A-10C Cockpit Build Thread My YouTube Channel
Aginor Posted June 3, 2014 Posted June 3, 2014 Reputation incoming! Also I think you should add a link to this thread into your sig, some people might be interested but don't know this project exists. I'll install it today and test it (hopefully). DCSW weapons cheat sheet speed cheat sheet
Boltz Posted June 3, 2014 Author Posted June 3, 2014 (edited) Thank you Aginor. I can't believe I didn't think of that before :doh: Edited June 3, 2014 by Boltz A-10C Cockpit Build Thread My YouTube Channel
Aginor Posted June 3, 2014 Posted June 3, 2014 (edited) Ok, I think I don't get it completely, so just for clarity: I have a single Mega 2560 R3 on COM3 as a UFC - ID should be 0 - One direct output for the Master Caution panel, a LED on pin 2 - a 2x2 Matrix for input, columns on pins 48 and 50, rows on pins 40 and 42(I always mix them up) So my controllers block looks like this: <controllers> <add id="00" type="Arduino Mega R3" name="UFC" port="3" baud="9600" init="A2DCS[iD:0;DO:2;MI:40,42,48,50;]"/> </controllers> Is that correct so far? Your commented config file is not as self-explanatory as you might think, I guess. I understand most of it, but I think most people won't. As soon as I understand it I can write a bit of documentation to help other users. (I might edit this post later to post the rest of the config if I can figure it out.) EDIT: Further questions: When I have a 2x2 Matrix, do the keys start with 0 or 1? So if I want to toggle the Master Caution button with the first switch in the first row, is this right? <add key="I[0,MI,0,0]" value="144,1" desc="Matrix MI, Switch 1, Value 1 mapped to DCSWorld Command 144 Args 1"/> or is it <add key="I[0,MI,1,1]" value="144,1" desc="Matrix MI, Switch 1, Value 1 mapped to DCSWorld Command 144 Args 1"/> Edited June 3, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
Boltz Posted June 3, 2014 Author Posted June 3, 2014 Yes. That is correct so far. I take your point on the config file. When I have some time I will try to see if I can make it easier to understand. That is the problem with creating things like this. I am so used to how it works that I forget I need to show others how it works. I'll get either a new config file or pdf up soon. A-10C Cockpit Build Thread My YouTube Channel
Boltz Posted June 3, 2014 Author Posted June 3, 2014 The switches start with a 0 so your first switch will be <add key="I[0,M1,0,0]" value="144,1" desc="Matrix MI, Switch 1, Value 1 mapped to DCSWorld Command 144 Args 1"/> A-10C Cockpit Build Thread My YouTube Channel
Aginor Posted June 3, 2014 Posted June 3, 2014 Ok, thx. I think a few examples explained in a PDF would do wonders. For example when I want more columns and rows in my matrix, where do I add them? Could you give an example how a 3x3 matrix would look like (the init part)? And the init part in the controller block is also hard to understand I guess, especially what the letters do, I understand that basically MI is a matrix (can there be more than one?), and DO is direct output, DI is direct input. DCSW weapons cheat sheet speed cheat sheet
Boltz Posted June 3, 2014 Author Posted June 3, 2014 Should you want to check switch numbers etc you can use the Serial Monitor in the Arduino software. Just send the initialisation string (in your case A2DCS[iD:0;DO:2;MI:40,42,48,50;]) to the Arduino. Then flick some switches and you will be able to see the direct results in the serial monitor. Ensure the baud rate is set to 9600 otherwise you will get some very strange results. A-10C Cockpit Build Thread My YouTube Channel
Boltz Posted June 3, 2014 Author Posted June 3, 2014 Ok, thx. I think a few examples explained in a PDF would do wonders. For example when I want more columns and rows in my matrix, where do I add them? Could you give an example how a 3x3 matrix would look like (the init part)? And the init part in the controller block is also hard to understand I guess, especially what the letters do, I understand that basically MI is a matrix (can there be more than one?), and DO is direct output, DI is direct input. Actually your init string is set for a 3x3 matrix. I first though that was what you were running. For a single 2x2 matrix you could have the rows on pins 40 and 41 with the columns on pins 42 and 43. The init string would be A2DCS[iD:0;DO:2;MI:40,41,42,43;]. A 3x3 matrix with rows on pins 40, 41 and 42 and columns on 43, 44 and 45 would be A2DCS[iD:0;DO:2;MI:40,42,43,45;]. A 5x5 matrix with rows on pins 40-44 and columns on rows 45-50 would be A2DCS[iD:0;DO:2;MI:40,44,45,50;]. There can be more than 1 matrix but to add more they must be declared in the Arduino sketch. I kept them out since I was running into memory errors while doing some extreme testing on an Uno. I hope this helps you :) A-10C Cockpit Build Thread My YouTube Channel
Aginor Posted June 3, 2014 Posted June 3, 2014 AH! Ok, now I understand the matrix. The pins just have to be next to each other. Copy that. I have some stuff showing up in the A2DCS window, for example that my button is pressed and the command 144,1 is triggered. But I'm not sure if the communication with DCS works. How can I check that? DCSW weapons cheat sheet speed cheat sheet
Boltz Posted June 3, 2014 Author Posted June 3, 2014 That is very good news! That means that A2DCS has registered the correct switch and has set the correct output command. Now if you follow the instructions in the PDF you will get the interface with DCS set up. After that just start A2DCS and then DCS, load a mission and test it out. A-10C Cockpit Build Thread My YouTube Channel
Aginor Posted June 3, 2014 Posted June 3, 2014 I have done that. Unfortunately nothing happens. I have done the following: in the Android.lua - entered my IP 192.168.155.106 - entered port 8989 (Helios uses 9089, is that not supposed to be the same one?) - Ticks = 4 Added A2DCS file to my Helios configuration .\\A2DCS\\Arduino.lua Unfortunately nothing yet. Can I manually send commands to DCS without the Arduino, just A2DCS?? Or perhaps it works and 144 is the wrong key? DCSW weapons cheat sheet speed cheat sheet
Boltz Posted June 3, 2014 Author Posted June 3, 2014 It seems you have fallen victim to my difficult config file. For input it should be: <add key="" value="C24,3001,1" desc="Master Caution Push" /> <add key="" value="C24,3001,0" desc="Master Caution Release" /> The complication is caused because of the way ED has designed DCS. Input and output use a completely different system and that took my a while to understand. I do not know where 144 has come from. I really do apologise for first telling you your config was correct. I was just looking at the controller stuff and skipped the input stuff. Edit: I was wrong. Fixed now A-10C Cockpit Build Thread My YouTube Channel
Aginor Posted June 3, 2014 Posted June 3, 2014 (edited) No problem, I'll try it in a minute.... I got the 144 from the DCSW export.lua. (some ancient one it seems) It contains some codes and I somehow assumed those were right. :D EDIT: ??? And where does the 3001 come from all of a sudden? And what is C24? And why is key empty now? I think we may miscommunicate right now^^ EDIT2: Nope, doesn't work. btw: Am I supposed to be able to see something in the areas of the A2DCS window labled input request from DCSW, Input Comannds from A2DCS or Output Values from DCSW? They stay empty. EDIT3: To rule out my existing Helios profile as cause of the error I created an empty new one, just with the DCS A-10C interface and the A2DCS file. Still no joy. Edited June 3, 2014 by Aginor DCSW weapons cheat sheet speed cheat sheet
Aginor Posted June 3, 2014 Posted June 3, 2014 Ok, now I also tried IP 127.0.0.1 for a change, doesn't work either. I also looked into the Export.lua to see whether Helios has put the dofile(".\\A2DCS\\Arduino.lua") in, and it has. I always confuse the several export.lua files. I think the one in Saved Games/DCS/Scripts is the one the game actually uses, or isn't it? They changed that at some time in the past IIRC... DCSW weapons cheat sheet speed cheat sheet
Boltz Posted June 3, 2014 Author Posted June 3, 2014 DCS uses the export.lua in Saved Games/DCS/Scripts. I should have said to use 127.0.0.1 if it is on the same PC as DCS. That option is really there for networking. 3001 came from the myconfig.xml which is the config file I use in my cockpit. C24 is the device ID for the UFC. I left key empty so that you could put in whatever you wanted. A-10C Cockpit Build Thread My YouTube Channel
Boltz Posted June 3, 2014 Author Posted June 3, 2014 (edited) I have missed something out in the instructions. You need to open the A2DCS.exe.config file and change the the following line to the same port number as you entered in the arduino.lua. <add key="tcp-port" value="8989"/> Also check that no firewall software is blocking the port. Edited June 3, 2014 by Boltz A-10C Cockpit Build Thread My YouTube Channel
Recommended Posts