From 9a11896358fb7ae1525de2799ac20a5c7303248f Mon Sep 17 00:00:00 2001 From: Kilian Kurt Hofmann Date: Sun, 15 Jan 2017 22:46:02 +0100 Subject: [PATCH] OnGround now works MISSING: Send of rev only if on ground Send not more than max forwards / max reverse (ON ARDUINO?) --- TQInterface/TQInterface.cpp | 7 +++++-- TQInterface/stdafx.h | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/TQInterface/TQInterface.cpp b/TQInterface/TQInterface.cpp index 5e772e4..63fe6b9 100644 --- a/TQInterface/TQInterface.cpp +++ b/TQInterface/TQInterface.cpp @@ -252,8 +252,7 @@ void CALLBACK MyDispatchProcTC(SIMCONNECT_RECV* pData, DWORD cbData, void *pCont switch (data->dwRequestID) { case AC_ON_GROUND_REQUEST: { - printf("\nOn ground: %f", &data->dwData); - onGround = (int)&data->dwData; + onGround = (int)((acOnGround *)&data->dwData)->onGround; break; } case AC_DATA_REQUEST: @@ -530,6 +529,10 @@ int __cdecl _tmain(int argc, _TCHAR* argv[]) } // Start TQ throttleControl(); + // Turn off + Sleep(10); + arduino->writeSerialPort("r", 1); + Sleep(10); } return 0; } diff --git a/TQInterface/stdafx.h b/TQInterface/stdafx.h index ae40894..f829fec 100644 --- a/TQInterface/stdafx.h +++ b/TQInterface/stdafx.h @@ -60,6 +60,10 @@ struct aircraftData { double lowerThrottleLimit; }; +struct acOnGround { + double onGround; +}; + // Structs for engines struct engineAll { double throttlePercent;