Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

branch softwarewire - third instance problem #110

Open
sqztom opened this issue Jan 3, 2020 · 1 comment
Open

branch softwarewire - third instance problem #110

sqztom opened this issue Jan 3, 2020 · 1 comment

Comments

@sqztom
Copy link

sqztom commented Jan 3, 2020

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 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 <Arduino.h>
#include <BME280I2CSoftwareWire.h>
#include <SoftwareWire.h>

// 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
Copy link
Owner

#123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants