Skip to content

Commit 8932a9b

Browse files
author
Elias Santistevan
committed
Fixes index position of the lux value conversion value
1 parent c15825b commit 8932a9b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/SparkFun_VEML6030_Ambient_Light_Sensor.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -437,9 +437,9 @@ uint32_t SparkFun_Ambient_Light::_calculateLux(uint16_t _lightBits){
437437
_convPos = 0;
438438
else if (_gain == 1.00)
439439
_convPos = 1;
440-
else if (_gain == .125)
441-
_convPos = 2;
442440
else if (_gain == .25)
441+
_convPos = 2;
442+
else if (_gain == .125)
443443
_convPos = 3;
444444
else
445445
return UNKNOWN_ERROR;
@@ -484,13 +484,13 @@ uint16_t SparkFun_Ambient_Light::_calculateBits(uint32_t _luxVal){
484484
// Here the gain is checked to get the position of the conversion value
485485
// within the integration time arrays. These values also represent the bit
486486
// values for setting the gain.
487-
if (_gain == 1.00)
487+
if (_gain == 2.00)
488488
_convPos = 0;
489-
else if (_gain == 2.00)
489+
else if (_gain == 1.00)
490490
_convPos = 1;
491-
else if (_gain == .125)
492-
_convPos = 2;
493491
else if (_gain == .25)
492+
_convPos = 2;
493+
else if (_gain == .125)
494494
_convPos = 3;
495495
else
496496
return UNKNOWN_ERROR;

0 commit comments

Comments
 (0)