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
This commit is contained in:
jasonshort 2011-01-18 06:11:48 +00:00
parent 8ec3a8de4a
commit d542c75d6e
1 changed files with 7 additions and 5 deletions

View File

@ -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();
}