edited colors and checked, that serial code works

This commit is contained in:
2025-08-05 10:45:08 +02:00
parent 2cf4b3b7fe
commit ac70053349
2 changed files with 6 additions and 4 deletions

View File

@@ -6,8 +6,8 @@ from matplotlib.animation import FuncAnimation
import re
# Serial settings (change COM port and baud rate as needed)
SERIAL_PORT = 'COM3' # e.g., 'COM3' on Windows or '/dev/ttyUSB0' on Linux/Mac
BAUD_RATE = 9600
SERIAL_PORT = '/dev/ttyACM0' # e.g., 'COM3' on Windows or '/dev/ttyUSB0' on Linux/Mac
BAUD_RATE = 115200
# Open serial connection
ser = serial.Serial(SERIAL_PORT, BAUD_RATE, timeout=1)
@@ -68,7 +68,8 @@ def get_faces(vertices):
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
box = create_box()
collection = Poly3DCollection([], facecolors='skyblue', edgecolors='black', alpha=0.8)
c = ['C0'] * 1 + ['C3'] + ['C0'] * 4
collection = Poly3DCollection([], facecolors=c, edgecolors='black', alpha=0.90) #facecolors='skyblue',edgecolors='black', alpha=0.8
ax.add_collection3d(collection)
ax.set_xlim([-1, 1])