Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Koseng authored May 26, 2021
1 parent d025bab commit 95077e0
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,33 @@
# MSFSPythonSimConnectMobiFlightExtension
Extends the python simconnect library for MSFS2020 with the capability to read A and L variables with help of the MobiFlight WASM module.
# MSFS Python SimConnect MobiFlight Extension
Extends the [python simconnect library](https://github.com/odwdinc/Python-SimConnect) for MSFS2020 with the capability to read A and L variables with help of the [MobiFlight](https://www.mobiflight.com) WASM module.

* ```SimConnectMobiFlight``` inherits from ```SimConnect```, fixes an issue and adds the feature to register additional client data handlers.
* ```MobiFlightVariableRequests``` implements the variable access via the MobiFlight WASM module.
* A collection of possible variables can be found [here](https://bitbucket.org/mobiflight/mobiflightfc/src/master/Presets/msfs2020_simvars.cip) in the [MobiFlight repository](https://bitbucket.org/mobiflight/mobiflightfc).
* ATTENTION: At the moment it is only possible for one client at a time to access variables via MobiFlight WASM. There is not yet multi client support.

## Example

**Example code on how to use the library and read variables:**
```python
from simconnect_mobiflight import SimConnectMobiFlight
from mobiflight_variable_requests import MobiFlightVariableRequests
from time import sleep

sm = SimConnectMobiFlight()
vr = MobiFlightVariableRequests(sm)
vr.clear_sim_variables()

while True:
alt_ground = vr.get("(A:GROUND ALTITUDE,Meters)")
alt_plane = vr.get("(A:PLANE ALTITUDE,Feet)")
# FlyByWire A320
ap1 = vr.get("(L:A32NX_AUTOPILOT_1_ACTIVE)")
hdg = vr.get("(L:A32NX_AUTOPILOT_HEADING_SELECTED)")
mode = vr.get("(L:A32NX_FMA_LATERAL_MODE)")
sleep(1)
```

## MobiFlight WASM working principle

![Picture principle](doc/mobiflightVarAccess.png)

0 comments on commit 95077e0

Please sign in to comment.