OP_SINGLE_HRES2 gets lux doubled
sullivanzheng opened this issue · 0 comments
sullivanzheng commented
return ((raw[0] << 24) | (raw[1] << 16)) // 78642
This segment of code is incorrect since under mode == OP_SINGLE_HRES2, the reading is doubled. So the result need to be divided by 2.
if mode == OP_SINGLE_HRES2:
return ((raw[0] << 24) | (raw[1] << 16)) // 78642 //2
else:
# we must divide the end result by 1.2 to get the lux
return ((raw[0] << 24) | (raw[1] << 16)) // 78642