Looking at the first page, I think we're looking at the T-Package.
I'm playing around with your code, but I'm really confused by the getLight() function. As far as I know, a semi-colon is used to put several lines of code on a single line. Are they necessary here?
I rewrote the code a little bit so that each value stored before being re-checked or altered by the code.
- Code: Select all
x = i2c.readU16(0xAE)
w = x
x <<= 16
I'm looking at page 17 and 18 on the datasheet. It mentions bit-shifting and shadow registers. Does this mean that it matters which register we read first? Should we be looking at 0xAC first and then OxAE? Experimenting with the code and subsequent data readouts, I am getting significantly different values when I switch which order I'm pulling the data.