From 35b476a90b585186161ab91ef9b73d029a2ee834 Mon Sep 17 00:00:00 2001 From: Abdellah El Morabit Date: Fri, 29 Nov 2024 23:54:15 +0100 Subject: made the first form of a practicle gui --- .idea/.gitignore | 3 ++ .idea/I2C.iml | 8 ++++ .idea/inspectionProfiles/profiles_settings.xml | 6 +++ .idea/misc.xml | 4 ++ .idea/modules.xml | 8 ++++ .idea/vcs.xml | 6 +++ source/.DS_Store | Bin 0 -> 6148 bytes source/__pycache__/hardware_driver.cpython-313.pyc | Bin 0 -> 12187 bytes source/main.py | 41 +++++++++++++++++++++ 9 files changed, 76 insertions(+) create mode 100644 .idea/.gitignore create mode 100644 .idea/I2C.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 source/.DS_Store create mode 100644 source/__pycache__/hardware_driver.cpython-313.pyc create mode 100644 source/main.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/I2C.iml b/.idea/I2C.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/I2C.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..23231ce --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..71e35f1 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/source/.DS_Store b/source/.DS_Store new file mode 100644 index 0000000..2b35964 Binary files /dev/null and b/source/.DS_Store differ diff --git a/source/__pycache__/hardware_driver.cpython-313.pyc b/source/__pycache__/hardware_driver.cpython-313.pyc new file mode 100644 index 0000000..d6c84ad Binary files /dev/null and b/source/__pycache__/hardware_driver.cpython-313.pyc differ diff --git a/source/main.py b/source/main.py new file mode 100644 index 0000000..62e47b2 --- /dev/null +++ b/source/main.py @@ -0,0 +1,41 @@ +from PySide6.QtWidgets import QApplication, QLabel, QMainWindow, QPushButton, QLabel, QVBoxLayout, QWidget +from PySide6.QtCore import Qt +from hardware_driver import lcd +import sys + + +L = lcd() + +class mainWindow(QMainWindow): + def __init__(self): + super().__init__() + self.setWindowTitle("I2C CONTROLLER") + self.setGeometry(200,100,800,300) + self.mainUI() + + def mainUI(self): + central_widget = QWidget(self) + self.setCentralWidget(central_Widget) + + self.label = QLabel("CONNECTED TO I2C DEVICE", self) + self.label.setAlignment(Qt.AlignCenter) + + self.button = QPushButton("Clear Screen", self) + self.button.clicked.connect(self.clear_screen) + + layout = QVBoxLayout() + layout.addWidget(self.label) + layout.addWidget(self.button) + + central_widget.setLayout(layout) + + def clear_screen(): + lcd.clear() + self.label.setText("Cleared the LCD screen", self) + +if __name__ == "__main__": + app = QApplication(sys.argv) + window = mainWindow() + window.show() + sys.exit(app.exec()) + -- cgit v1.2.3-70-g09d2