From 29fdb2c512e2b0576faf4011a2311200300335be Mon Sep 17 00:00:00 2001 From: Avi Levkovich Date: Wed, 8 Aug 2018 16:46:19 +0300 Subject: fix bug in Dispenser Pressure calculation --- Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'Software/Embedded_SW/Embedded/Modules') diff --git a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c index 374ab444f..87274f904 100644 --- a/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c +++ b/Software/Embedded_SW/Embedded/Modules/IDS/IDS_init.c @@ -35,9 +35,9 @@ void Calculateinit (void) Bits_0Pascal = Vlow * 4096 / 3; // Vlow * 4096bit / 3Vref = 709.973328 bits Bits_1MPascal = VHigh * 4096 / 3; // VHigh * 4096bit / 3Vref = 3549.86646 bits - a = (1 - 0) / (Bits_1MPascal - Bits_0Pascal);// Mpascal/Bits = 0.000352125 + float a = (Bits_1MPascal - Bits_0Pascal) / (1 - 0) ;// Mpascal/Bits = - b = 0 - (a * Bits_0Pascal ); + float b = Bits_0Pascal - (a * 0 ); } float CalculateDispenserPressure (int DispenserId) @@ -58,7 +58,7 @@ float CalculateDispenserPressure (int DispenserId) if(data