import numpy as np import serial import struct # Hàm gửi dữ liệu qua cổng serial def send_data(data): num_rows = data.shape[0] num_cols = data.shape[1] # Chuyển mảng thành chuỗi byte data_bytes = data.tobytes() # Đóng gói kích thước và dữ liệu header = struct.pack('