From d542c75d6ec73c6a408c397b204373d5cf6823ec Mon Sep 17 00:00:00 2001 From: jasonshort Date: Tue, 18 Jan 2011 06:11:48 +0000 Subject: [PATCH] Added current total to the log. Logging at a lower rate. decreased size to ints. git-svn-id: https://arducopter.googlecode.com/svn/trunk@1510 f9c3cf11-9bcb-44bc-f272-b75c42450872 --- ArduCopterMega/Log.pde | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ArduCopterMega/Log.pde b/ArduCopterMega/Log.pde index 7392701298..b560b9800b 100644 --- a/ArduCopterMega/Log.pde +++ b/ArduCopterMega/Log.pde @@ -345,18 +345,20 @@ void Log_Write_Current() DataFlash.WriteByte(HEAD_BYTE1); DataFlash.WriteByte(HEAD_BYTE2); DataFlash.WriteByte(LOG_CURRENT_MSG); - DataFlash.WriteLong((long)(current_voltage * 1000.0)); - DataFlash.WriteLong((long)(current_amps * 1000.0)); + DataFlash.WriteInt((int)(current_voltage * 100.0)); + DataFlash.WriteInt((int)(current_amps * 100.0)); + DataFlash.WriteInt((int)(current_total * 10.0)); DataFlash.WriteByte(END_BYTE); } // Read a Current packet void Log_Read_Current() { - float logvoltage, logcurrent; Serial.print("CURR:"); - Serial.print((float)DataFlash.ReadLong() / 1000.f); + Serial.print((float)DataFlash.ReadInt() / 100.f); Serial.print(comma); - Serial.print((float)DataFlash.ReadLong() / 1000.f); + Serial.print((float)DataFlash.ReadInt() / 100.f); + Serial.print(comma); + Serial.print((float)DataFlash.ReadInt() / 10.f); Serial.println(); }