claws / BH1750

An Arduino library for the digital light sensor breakout boards containing the BH1750FVI IC
MIT License
252 stars 108 forks source link

How can I set I2C adress? #7

Closed FrankenApps closed 8 years ago

FrankenApps commented 8 years ago

I use the sensor together with other I2C devices on one arduino and therfore would like to set a unique I2C adress for the sensor.

FrankenApps commented 8 years ago

I know that I can change it by setting a new value in BH1750.h, line 28: #define BH1750_I2CADDR 0x23, but it would be nice if we would be able to change it in the code directly, not in the library...

claws commented 8 years ago

It should be possible to support this, within the constraints of the device's limitations. The device only supports two addresses; 0x23 and 0x5C. With ADD not connected the address is 0x23 and when ADD is pulled high the address becomes 0x5C.

FrankenApps commented 8 years ago

Ahh, ok i should have looked up, what this addr pin is for... Thank you very much!