먼저 simconnect 설치가 필요하다.
https://pypi.org/project/SimConnect/
SimConnect
Adds a pythonic wrapper for SimConnect SDK.
pypi.org
pip install SimConnect
설치가 완료되면 아래 예제를 실행 해 보자.
import simconnect
import time
# Connect to SimConnect
sm = simconnect.SimConnect()
# Define the aircraft object
aircraft = sm.add_aircraft_object("Aircraft")
# Set the current heading of the aircraft to 270 degrees
heading = 270
aircraft.HEADING_INDICATOR = heading
sm.set_data_on_sim_object(aircraft)
# Wait for 1 second
time.sleep(1)
# Set the current heading of the aircraft to 180 degrees
heading = 180
aircraft.HEADING_INDICATOR = heading
sm.set_data_on_sim_object(aircraft)
# Close the SimConnect connection
sm.close()
'Home Cockpit > DIY' 카테고리의 다른 글
[Falcon BMS] RTT 를 이용한 화면 만들기 (0) | 2023.04.27 |
---|---|
[MSFS] pmdg 737 Data Access (1) | 2023.04.20 |
[MSFS-DIY] simconnect documentation (0) | 2023.04.05 |
[MSFS-DIY] arduino tm1637 segment 출 (0) | 2023.04.04 |
아두이노 7 Segment 선택하기 (0) | 2023.03.17 |
댓글