finitespace / BME280

Provides an Arduino library for reading and interpreting Bosch BME280 data over I2C, SPI or Sw SPI.
GNU General Public License v3.0
212 stars 105 forks source link

branch softwarewire - third instance problem #110

Open sqztom opened 4 years ago

sqztom commented 4 years ago

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 ?

/ 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); }

finitespace commented 3 years ago

123