def __init__(self, config): SensorWrapper.__init__(self, config) # Additional config option for i2c address, default to 0x33 self.address = int(config.get('address', "0x33"), 16) # Create sensor object self.sensor = seeed_mlx9064x.grove_mxl90640(address=self.address) self.sensor.refresh_rate = seeed_mlx9064x.RefreshRate.REFRESH_4_HZ
def main(): if CHIP_TYPE == 'MLX90641': mlx = seeed_mlx9064x.grove_mxl90641() frame = [0] * 192 elif CHIP_TYPE == 'MLX90640': mlx = seeed_mlx9064x.grove_mxl90640() frame = [0] * 768 mlx.refresh_rate = seeed_mlx9064x.RefreshRate.REFRESH_8_HZ # The fastest for raspberry 4 time.sleep(1) while True: start = time.time() mlx.getFrame(frame) print(frame) end = time.time() print("The time: %f" % (end - start))
def main(): if CHIP_TYPE == 'MLX90641': mlx = seeed_mlx9064x.grove_mxl90641() frame = [0] * 192 elif CHIP_TYPE == 'MLX90640': mlx = seeed_mlx9064x.grove_mxl90640() frame = [0] * 768 while True: try: frames = take_ten_frames(mlx, frame) save_ten_frames(frames, save_filepath) except KeyboardInterrupt: break
def main(): if CHIP_TYPE == 'MLX90641': mlx = seeed_mlx9064x.grove_mxl90641() frame = [0] * 192 elif CHIP_TYPE == 'MLX90640': mlx = seeed_mlx9064x.grove_mxl90640() frame = [0] * 768 time.sleep(1) while True: start = time.time() try: mlx.getFrame(frame) except ValueError: continue # print(frame) end = time.time() print("The time: %f"%(end - start))
def main(): if CHIP_TYPE == 'MLX90641': mlx = seeed_mlx9064x.grove_mxl90641() frame = [0] * 192 elif CHIP_TYPE == 'MLX90640': mlx = seeed_mlx9064x.grove_mxl90640() frame = [0] * 768 time.sleep(1) while True: start = time.time() try: mlx.getFrame(frame) except ValueError: continue print(frame) frame = np.array(frame) frame_formatted = np.reshape(frame, (24, 32)) plt.imshow(frame_formatted, cmap='hot', interpolation='nearest') plt.show() end = time.time() print("The time: %f" % (end - start))
def __init__(self, port, ChipType="MLX90640"): super(DataReader, self).__init__() self.frameCount = 0 # i2c mode if ChipType == "MLX90640": DataReader.pixel_num = 768 elif ChipType == "MLX90641": DataReader.pixel_num = 192 if port == 'I2C': if ChipType == "MLX90640": self.dataHandle = seeed_mlx9064x.grove_mxl90640() self.dataHandle.refresh_rate = seeed_mlx9064x.RefreshRate.REFRESH_8_HZ elif ChipType == "MLX90641": self.dataHandle = seeed_mlx9064x.grove_mxl90641() self.dataHandle.refresh_rate = seeed_mlx9064x.RefreshRate.REFRESH_8_HZ self.readData = self.i2cRead else: self.MODE = DataReader.SERIAL self.port = port self.dataHandle = Serial(self.port, 115200, timeout=5) self.readData = self.serialRead