Skip to content

Commit

Permalink
fix: mlx90640 data error
Browse files Browse the repository at this point in the history
  • Loading branch information
Hansen0314 committed Jul 10, 2020
1 parent c4f57b1 commit 2133af4
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
2 changes: 1 addition & 1 deletion examples/BasicReadings.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def main():
mlx.getFrame(frame)
except ValueError:
continue
print(frame)
# print(frame)
end = time.time()
print("The time: %f"%(end - start))
if __name__ == '__main__':
Expand Down
37 changes: 18 additions & 19 deletions seeed_mlx9064x.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,23 +318,23 @@ def _ExtractParameters(self):
self._ExtractDeviatingPixels()

# debug output
#print('-'*40)
#print("kVdd = %d, vdd25 = %d" % (self.kVdd, self.vdd25))
#print("KvPTAT = %f, KtPTAT = %f, vPTAT25 = %d, alphaPTAT = %f" %
# (self.KvPTAT, self.KtPTAT, self.vPTAT25, self.alphaPTAT))
#print("Gain = %d, Tgc = %f, Resolution = %d" % (self.gainEE, self.tgc, self.resolutionEE))
#print("KsTa = %f, ksTo = %s, ct = %s" % (self.KsTa, self.ksTo, self.ct))
#print("cpAlpha:", self.cpAlpha, "cpOffset:", self.cpOffset)
#print("alpha: ", self.alpha)
#print("alphascale: ", self.alphaScale)
#print("offset: ", self.offset)
#print("kta:", self.kta)
#print("ktaScale:", self.ktaScale)
#print("kv:", self.kv)
#print("kvScale:", self.kvScale)
#print("calibrationModeEE:", self.calibrationModeEE)
#print("ilChessC:", self.ilChessC)
#print('-'*40)
# print('-'*40)
# print("kVdd = %d, vdd25 = %d" % (self.kVdd, self.vdd25))
# print("KvPTAT = %f, KtPTAT = %f, vPTAT25 = %d, alphaPTAT = %f" %
# (self.KvPTAT, self.KtPTAT, self.vPTAT25, self.alphaPTAT))
# print("Gain = %d, Tgc = %f, Resolution = %d" % (self.gainEE, self.tgc, self.resolutionEE))
# print("KsTa = %f, ksTo = %s, ct = %s" % (self.KsTa, self.ksTo, self.ct))
# print("cpAlpha:", self.cpAlpha, "cpOffset:", self.cpOffset)
# print("alpha: ", self.alpha)
# print("alphascale: ", self.alphaScale)
# print("offset: ", self.offset)
# print("kta:", self.kta)
# print("ktaScale:", self.ktaScale)
# print("kv:", self.kv)
# print("kvScale:", self.kvScale)
# print("calibrationModeEE:", self.calibrationModeEE)
# print("ilChessC:", self.ilChessC)
# print('-'*40)

def _ExtractVDDParameters(self):
# extract VDD
Expand Down Expand Up @@ -1123,11 +1123,10 @@ def _ExtractCPParameters(self):
if self.cpOffset > 32767:
self.cpOffset -= 65536

alphaScale = eeData[46]
self.cpAlpha = eeData[45]
if self.cpAlpha > 1023 :
self.cpAlpha = self.cpAlpha - 2048
self.cpAlpha /= math.pow(2,alphaScale)
self.cpAlpha //= math.pow(2,self.cpAlpha)

self.cpKta = eeData[49] & 0x001F
if self.cpKta > 31:
Expand Down

0 comments on commit 2133af4

Please sign in to comment.