# data[].attributes.attachment_link.readable_text
import sys
from PyQt6.QtWidgets import QApplication, QWidget, QPushButton, QVBoxLayout
import serial

# ������������������������
serial_port = "/dev/ttyUSB0"  # ������������������������������
baud_rate = 9600

class LEDControlGUI(QWidget):
    def __init__(self):
        super().__init__()

        # ������������������
        self.serial_connection = serial.Serial(serial_port, baud_rate)

        self.init_ui()

    def init_ui(self):
        layout = QVBoxLayout()

        # ������1���������1
        btn_mode1 = QPushButton("Mode Scriabin")
        btn_mode1.clicked.connect(lambda: self.send_mode(1))
        layout.addWidget(btn_mode1)

        # ������2���������2
        btn_mode2 = QPushButton("Mode MIDI Controller")
        btn_mode2.clicked.connect(lambda: self.send_mode(2))
        layout.addWidget(btn_mode2)

        # ������3���������3
        btn_mode3 = QPushButton("Mode Sequencer")
        btn_mode3.clicked.connect(lambda: self.send_mode(3))
        layout.addWidget(btn_mode3)

        self.setLayout(layout)
        self.setWindowTitle("LED Control")

    def send_mode(self, mode):
        # ������������������������Keil Mbed
        self.serial_connection.write(bytes([mode]))

if __name__ == "__main__":
    app = QApplication(sys.argv)
    gui = LEDControlGUI()
    gui.show()
    sys.exit(app.exec())

# data[].attributes.attachment_link.description
Documentation of technical platform. Contribute to IOGS-LEnsE-embedded/Maquettes_LEnsE development by creating an account on GitHub.