def main(): mlx = seeed_mlx90640.grove_mxl90640() frame = [0] * 768 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(): mlx = seeed_mlx90640.grove_mxl90640() mlx.refresh_rate = seeed_mlx90640.RefreshRate.REFRESH_8_HZ # The fastest for raspberry 4 frame = [0] * 768 while True: start = time.time() try: mlx.getFrame(frame) except ValueError: continue print(frame) end = time.time() print("The time: %f" % (end - start))
def __init__(self, port): super(DataReader, self).__init__() self.frameCount = 0 # i2c mode if port is None: self.dataHandle = seeed_mlx90640.grove_mxl90640() self.dataHandle.refresh_rate = seeed_mlx90640.RefreshRate.REFRESH_4_HZ self.readData = self.i2cRead else: self.MODE = DataReader.SERIAL self.port = port self.dataHandle = Serial(self.port, 2000000, timeout=5) self.readData = self.serialRead
def main(): limit = 0 start = time.time() mlx = seeed_mlx90640.grove_mxl90640() mlx.refresh_rate = seeed_mlx90640.RefreshRate.REFRESH_4_HZ # The fastest for Raspberry Pi Zero W with open('thermal.csv', 'a') as csvfile: csvwriter = csv.writer(csvfile) while limit < 300: try: frame = [0] * 768 mlx.getFrame(frame) csvwriter.writerow(frame) #limit += 1 except ValueError: continue #time.sleep(10) print(time.time() - start)
def __init__(self): self.mlx = seeed_mlx90640.grove_mxl90640() self.mlx.refresh_rate = seeed_mlx90640.RefreshRate.REFRESH_2_HZ # The fastest for Raspberry Pi Zero W self.thermal_data = ThermalData()
# print("Mapping: "+ str(t)) r = 0 g = 0 b = 0 if t < 255: g = t b = 255 if t >= 255 and t < 510: r = 255 g = 255 - (t - 255) if t >= 510: r = 255 b = (t - 510) draw_rectangle(x, y, int(r), int(g), int(b)) mlx = seeed_mlx90640.grove_mxl90640() mlx.refresh_rate = seeed_mlx90640.RefreshRate.REFRESH_0_5_HZ windows = tk.Tk() windows.title('test') windows.geometry('500x500') c = tk.Canvas(windows, width=800, height=800) c.grid(row=1, column=0) frame = [0] * 768 label_frame = tk.Frame(windows) label_frame.grid(row=0, column=0, sticky='w') low_label = tk.Label(label_frame, text="Lowest Temp: ") low_label.grid(row=0, column=0, sticky='w')