OnGround now works

MISSING:
Send of rev only if on ground
Send not more than max forwards / max reverse (ON ARDUINO?)
This commit is contained in:
Kilian Kurt Hofmann 2017-01-15 22:46:02 +01:00
parent 14c6361fbd
commit 9a11896358
2 changed files with 9 additions and 2 deletions

View File

@ -252,8 +252,7 @@ void CALLBACK MyDispatchProcTC(SIMCONNECT_RECV* pData, DWORD cbData, void *pCont
switch (data->dwRequestID) { switch (data->dwRequestID) {
case AC_ON_GROUND_REQUEST: case AC_ON_GROUND_REQUEST:
{ {
printf("\nOn ground: %f", &data->dwData); onGround = (int)((acOnGround *)&data->dwData)->onGround;
onGround = (int)&data->dwData;
break; break;
} }
case AC_DATA_REQUEST: case AC_DATA_REQUEST:
@ -530,6 +529,10 @@ int __cdecl _tmain(int argc, _TCHAR* argv[])
} }
// Start TQ // Start TQ
throttleControl(); throttleControl();
// Turn off
Sleep(10);
arduino->writeSerialPort("r", 1);
Sleep(10);
} }
return 0; return 0;
} }

View File

@ -60,6 +60,10 @@ struct aircraftData {
double lowerThrottleLimit; double lowerThrottleLimit;
}; };
struct acOnGround {
double onGround;
};
// Structs for engines // Structs for engines
struct engineAll { struct engineAll {
double throttlePercent; double throttlePercent;