Skip to content

Commit 95077e0

Browse files
authored
Update README.md
1 parent d025bab commit 95077e0

1 file changed

Lines changed: 33 additions & 2 deletions

File tree

README.md

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
1-
# MSFSPythonSimConnectMobiFlightExtension
2-
Extends the python simconnect library for MSFS2020 with the capability to read A and L variables with help of the MobiFlight WASM module.
1+
# MSFS Python SimConnect MobiFlight Extension
2+
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.
3+
4+
* ```SimConnectMobiFlight``` inherits from ```SimConnect```, fixes an issue and adds the feature to register additional client data handlers.
5+
* ```MobiFlightVariableRequests``` implements the variable access via the MobiFlight WASM module.
6+
* 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).
7+
* 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.
8+
9+
## Example
10+
11+
**Example code on how to use the library and read variables:**
12+
```python
13+
from simconnect_mobiflight import SimConnectMobiFlight
14+
from mobiflight_variable_requests import MobiFlightVariableRequests
15+
from time import sleep
16+
17+
sm = SimConnectMobiFlight()
18+
vr = MobiFlightVariableRequests(sm)
19+
vr.clear_sim_variables()
20+
21+
while True:
22+
alt_ground = vr.get("(A:GROUND ALTITUDE,Meters)")
23+
alt_plane = vr.get("(A:PLANE ALTITUDE,Feet)")
24+
# FlyByWire A320
25+
ap1 = vr.get("(L:A32NX_AUTOPILOT_1_ACTIVE)")
26+
hdg = vr.get("(L:A32NX_AUTOPILOT_HEADING_SELECTED)")
27+
mode = vr.get("(L:A32NX_FMA_LATERAL_MODE)")
28+
sleep(1)
29+
```
30+
31+
## MobiFlight WASM working principle
32+
33+
![Picture principle](doc/mobiflightVarAccess.png)

0 commit comments

Comments
 (0)