Skip to content

Commit 2636b0f

Browse files
authored
Merge pull request #3 from sparkfun/release_candidate
v1.0.3 - correct use of current coarse gain
2 parents d4a9292 + 30bbb36 commit 2636b0f

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=SparkFun ACS37800 Power Monitor Arduino Library
2-
version=1.0.2
2+
version=1.0.3
33
author=SparkFun Electronics
44
maintainer=SparkFun Electronics
55
sentence=Library for the Allegro MicroSystems ACS37800 power monitor IC

src/SparkFun_ACS37800_Arduino_Library.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ ACS37800ERR ACS37800::readRMS(float *vRMS, float *iRMS)
563563

564564
//Extract the irms. Convert to current in Amps.
565565
//Datasheet says: "RMS current output. This field is a signed 16-bit fixed point number with 15 fractional bits"
566-
//Extract the vcodes. Convert to voltage in Volts.
567566
union
568567
{
569568
int16_t Signed;
@@ -581,7 +580,6 @@ ACS37800ERR ACS37800::readRMS(float *vRMS, float *iRMS)
581580
}
582581
amps /= 27500.0; //Convert from codes to the fraction of ADC Full Scale (15-bit)
583582
amps *= _currentSensingRange; //Convert to Amps
584-
amps /= _currentCoarseGain / 4.5; // Correct for the coarse gain
585583
if (_printDebug == true)
586584
{
587585
_debugPort->print(F("readRMS: amps (A, after correction) is "));
@@ -652,7 +650,6 @@ ACS37800ERR ACS37800::readInstantaneous(float *vInst, float *iInst, float *pInst
652650
}
653651
amps /= 27500.0; //Convert from codes to the fraction of ADC Full Scale
654652
amps *= _currentSensingRange; //Convert to Amps
655-
amps /= _currentCoarseGain / 4.5; // Correct for the coarse gain
656653
if (_printDebug == true)
657654
{
658655
_debugPort->print(F("readInstantaneous: amps (A, after correction) is "));

0 commit comments

Comments
 (0)