Skip to content

Commit

Permalink
fixed watt-hour and amp-hour calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
paulwrath1223 committed Dec 19, 2023
1 parent b5a542e commit 9629933
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,8 @@ async fn main() -> Result<(), BatTestError>{
output.flush()?;
let avg_amps = amps_sum/entries as f64;
let avg_watts = watts_sum/entries as f64;
let total_amp_hours = avg_amps/total_hours;
let total_watt_hours = avg_watts/total_hours;
let total_amp_hours = avg_amps*total_hours;
let total_watt_hours = avg_watts*total_hours;
println!("Discharge complete. Sucked {} watt hours and {} amp hours out of that bad boy.", total_watt_hours, total_amp_hours);
output.write_record(&["","",""])?;
output.write_record(&["Finish time","Watt hours","Amp hours"])?;
Expand Down

0 comments on commit 9629933

Please sign in to comment.