trying to get 6 sensors on 3 buses ( BME280 allows two addresses on I2C bus)
/code minimized to show problem /
code below not compiled with linker error:
ltrans0.ltrans.o:(.rodata+0x1a): undefined reference to BME280I2C::WriteRegister(unsigned char, unsigned char)' ltrans0.ltrans.o:(.rodata+0x1c): undefined reference toBME280I2C::ReadRegister(unsigned char, unsigned char*, unsigned char)'
collect2.exe: error: ld returned 1 exit status
commenting out any of lines :
SoftwareWire BusI2cX(a, b);
and both Arduino and PIO finishes fompilation flawlessly
Only two instances allowed ? why ?
trying to get 6 sensors on 3 buses ( BME280 allows two addresses on I2C bus) /code minimized to show problem / code below not compiled with linker error:
ltrans0.ltrans.o:(.rodata+0x1a): undefined reference to
BME280I2C::WriteRegister(unsigned char, unsigned char)' ltrans0.ltrans.o:(.rodata+0x1c): undefined reference to
BME280I2C::ReadRegister(unsigned char, unsigned char*, unsigned char)' collect2.exe: error: ld returned 1 exit statuscommenting out any of lines : SoftwareWire BusI2cX(a, b);
and both Arduino and PIO finishes fompilation flawlessly Only two instances allowed ? why ?
/ BME280_I2C_SoftwareWire_Test.ino https://github.com/finitespace/BME280/branches /
include
include
include
// SoftwareWire softwareWire(SDA, SCK); - define three buses SoftwareWire BusI2cA(22, 23); SoftwareWire BusI2cB(24, 25); SoftwareWire BusI2cC(26, 27);
//BME280I2CSoftwareWire bme(softwareWire); // Default : forced mode, standby time = 1000 ms // define three instances BME280I2CSoftwareWire bme1(BusI2cA); BME280I2CSoftwareWire bme2(BusI2cB); BME280I2CSoftwareWire bme3(BusI2cC);
////////////////////////////////////////////////////////////////// void setup() { } void loop() { delay(500); }