Skip to content

Commit fc0d31e

Browse files
Removing hard coded I2CAddress
Removed hard-coded I2CAddress "0x5B" from constructor which caused issues when trying to use the alternative address "0x5A". Also, removed member assignment of I2CAddress as it is done by member initialisation list in constructor.
1 parent fceb615 commit fc0d31e

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/SparkFunCCS811.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,13 @@ Distributed as-is; no warranty is given.
3535

3636
//****************************************************************************//
3737
//
38-
// LIS3DHCore functions
39-
//
40-
// For I2C, construct LIS3DHCore myIMU(<address>);
38+
// CCS811Core functions
4139
//
4240
// Default <address> is 0x5B.
4341
//
4442
//****************************************************************************//
45-
CCS811Core::CCS811Core( uint8_t inputArg ) : I2CAddress(0x5B)
43+
CCS811Core::CCS811Core( uint8_t inputArg ) : I2CAddress(inputArg)
4644
{
47-
I2CAddress = inputArg;
48-
4945
}
5046

5147
CCS811Core::status CCS811Core::beginCore(void)
@@ -535,4 +531,4 @@ float CCS811::getResistance( void )
535531
float CCS811::getTemperature( void )
536532
{
537533
return temperature;
538-
}
534+
}

0 commit comments

Comments
 (0)