From ab945f36df13accb01f8ee646eb67ace5af0a0bd Mon Sep 17 00:00:00 2001 From: Jason Short Date: Fri, 24 Feb 2012 12:10:58 -0800 Subject: [PATCH] Compass heading added to ATT log --- ArduCopter/Log.pde | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ArduCopter/Log.pde b/ArduCopter/Log.pde index 4866b15a9d..c05be04cac 100644 --- a/ArduCopter/Log.pde +++ b/ArduCopter/Log.pde @@ -701,6 +701,7 @@ static void Log_Write_Attitude() DataFlash.WriteInt((int)dcm.pitch_sensor); // 4 DataFlash.WriteInt(g.rc_4.control_in); // 5 DataFlash.WriteInt((uint16_t)dcm.yaw_sensor); // 6 + DataFlash.WriteInt((uint16_t)compass.heading); // 6 DataFlash.WriteByte(END_BYTE); } @@ -714,15 +715,18 @@ static void Log_Read_Attitude() int16_t temp4 = DataFlash.ReadInt(); int16_t temp5 = DataFlash.ReadInt(); uint16_t temp6 = DataFlash.ReadInt(); + uint16_t temp7 = DataFlash.ReadInt(); + temp7 = wrap_360(temp7); - // 1 2 3 4 5 6 - Serial.printf_P(PSTR("ATT, %d, %d, %d, %d, %d, %u\n"), + // 1 2 3 4 5 6 7 + Serial.printf_P(PSTR("ATT, %d, %d, %d, %d, %d, %u, %u\n"), temp1, temp2, temp3, temp4, temp5, - temp6); + temp6, + temp7); } // Write a mode packet. Total length : 7 bytes