diff --git a/README.md b/README.md index 9d8e9af..2504aa9 100644 --- a/README.md +++ b/README.md @@ -27,6 +27,42 @@ ser.write(data_to_send) ser.close() ``` + +### Testing Game + +```python +import numpy as np +import serial +import struct + +# Tạo mảng NumPy +n = 2 +# Kích thước của mảng + +num_rows = 1 +num_cols = 0 + +data = np.array([[60, 120,1]]).astype(np.float32) +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('