Getting aircraft Simconnect variables and Lvars and sending it to arduino using just SimConnect, C++ and Arduino

Hey guys, I wrote a code to get the parking brake position of default a320 neo in MSFS and sent it to Arduino via serial port. I did not want to go via any GUI-based tool like MobiFlight. I know that I might be re-inventing the wheel but I could not find any non-GUI/API-based interface for getting aircraft variables. Does @MobiFlight or any similar software provide API through which we can do stuff like get and send data? I mostly work with python and my cpp knowledge is limited. Nevertheless, I have given my best shot to close the first version successfully. I am afraid it might not be optimized for performance and it handles only one aircraft variable now (parking brake). I am also concerned of other aspects like WASM. I do not really know what it is or how I can use to improve my codebase (requesting experts here to throw some light regarding this with respect to my code. I want to improve the code performance and if WASM helps there, then it’s win for all of us I guess) So far, since I fetch only parking brake info, I don’t face any latency. My code and instructions can be found in GitHub - edwinvarghese4442/rowentas-sync

Big thanks to the community as I found good info here

3 Likes

Updated code to read 2 Lvars of flybywire A320 and 1 sim variable of the same aircraft. Only difference in the code is to add a prefix of ‘L:’ before the API usage term. Find the full list of variables used in the code

  1. L:A32NX_TRK_FPA_MODE_ACTIVE
  2. AUTOPILOT MANAGED SPEED IN MACH
  3. L:A32NX_PARK_BRAKE_LEVER_POS

I guess you no longer require WASM module to read or write to Lvars of 3rd party aircraft.

I realized it super late by reading this thread :confused:Can you read/write aircraft specific variables (LVARs and HVARS) through simconnect? | FSDeveloper

Official Doc → SimConnect_AddToDataDefinition

1 Like

This is exactly what I’ve been looking for, but I’m new to coding beyond Arduino/ESP32 on platformio. I apologise if this is a stupid question.
I made an empty C++ project and added the RequestData.cpp file into the source files folder, added simconnect.h and simconnect.dll into resource files, and am getting the error when pressing ‘start without debugging’ saying ‘the code execution cannot proceed because SimConnect.dll was not found’, where should I put simconnect.dll in the folder structure?