Two I2C Adafruit Libraries Merging

Hi All,

Still very green with particle IO devices but trying to make sense of the code for two libraries

I have two devices

  • Adafruit TSL2561 Digital Luminosity/Lux/Light Sensor Breakout
  • BMP180 Barometric Pressure/Temperature/Altitude Sensor

I found two libraries however one appears to use the Analog Pins and the other uses digital pins for the CL and DA lines.

  • Connect SCL to analog 5
  • Connect SDA to analog 4
  • BMP085 SCL to D1
  • BMP085 SDA to D0

I’m trying to find the spot in one of the libraries where I can adjust this so that they use common pins.

Looking at the TSL2561 library it is using the Adafruit_Sensor class and I am likely going to have to completely gut and rewrite the BMP085 library to work in unison with this.

Any tips at this stage?

The only I2C pins on the Photon are D0/D1, but A4 & A5 are the SPI signals MISO and MOSI, but where do you see the reference to A4/A5 in the TSL2561 library?

On this example from the library.

So are you saying both will work side by then?

I see!
I guess that’s just the copy-paste of the original Adafruit library comment. Just try D0/D1 with that lib.

1 Like

Thanks it worked a treat!!!

1 Like