I am Agoston, and new here.
First of all I would like to say congratulations to this C172 add-on. It is amazing.
That's the reason why I chose to use your add-on to build my own cockpit.
I am not intending to use hardware from shop, except for the yoke and the pedals, so I am gonna build and design everything on my own.
The concept is that all switches and stuff will be connected to a microcontroller, and that communicates to the PC on serial port.
I just finished the prototype of the light panel. Now I am working on the software.
I am using a C# windows form application.
I can already read the states of switches from the microcontroller, and I can send events to SimConnect so that the switches move in FSX whenever i move the real ones.
Now I am trying to syncronize the switches of fsx and my cockpit on startup.
That's where the problem is.
I am using this line of code to access the state of the master battery switch:
Code: Select all
simconnect.AddToDataDefinition(Cockpit.DEFINITIONS.SyncDataStruct, "ELECTRICAL MASTER BATTERY",
"bool", SIMCONNECT_DATATYPE.INT32, 0.0f, SimConnect.SIMCONNECT_UNUSED);
I found the PDF with the A2A local variables, and I suppose, I should access somehow this variable: Battery1Switch.
But I could not find out how. If I simply replave ELECTRICAL MASTER BATTERY with Battery1Switch, I don't get the correct result...
How can I get the correct value?
I tried many google searches but none of the results gave me the answer...
Thank's in advance!
Agoston