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
def getLight():
x = i2c.readU16(0xAE)
w = x
x <<= 16
y=x
x|=i2c.readU16(0xAC)
return w,x,y
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.