|
@@ -0,0 +1,61 @@
|
|
|
+"""
|
|
|
+Author: Tobias Müller
|
|
|
+Date: 30.06.2023
|
|
|
+Version: 1.0
|
|
|
+
|
|
|
+This file contains classes for LCD, Button and Led control.
|
|
|
+"""
|
|
|
+
|
|
|
+############################## Modules ##############################
|
|
|
+
|
|
|
+from time import sleep_us
|
|
|
+from machine import Pin, PWM, I2C
|
|
|
+
|
|
|
+############################## Code ##############################
|
|
|
+
|
|
|
+class LCD:
|
|
|
+
|
|
|
+ ############################## Attributes ##############################
|
|
|
+
|
|
|
+ __lcd_setting = {}
|
|
|
+
|
|
|
+ ############################## Constructor ##############################
|
|
|
+
|
|
|
+ def __init__(self):
|
|
|
+
|
|
|
+ self.__lcd_brightness = self.__check_lcd_brightness(100)
|
|
|
+
|
|
|
+ ############################## Properties ##############################
|
|
|
+
|
|
|
+ @property
|
|
|
+ def lcd_brightness(self):
|
|
|
+ return self.__lcd_brightness
|
|
|
+
|
|
|
+ @lcd_brightness.setter
|
|
|
+ def lcd_brightness(self, value: int):
|
|
|
+ self.__lcd_brightness = self.__check_lcd_brightness(value)
|
|
|
+ self.__set_lcd_brightness()
|
|
|
+
|
|
|
+ ############################## Methods private ##############################
|
|
|
+
|
|
|
+ @staticmethod
|
|
|
+ def __check_lcd_brightness(value):
|
|
|
+ if not isinstance(value, int):
|
|
|
+ raise ValueError(f"Value \"{value}\" for \"lcd_brightness\" is not type \"int\"!")
|
|
|
+ elif value < 0 or value > 100:
|
|
|
+ raise ValueError(f"Value \"{value}\" for \"lcd_brightness\" is out of range!")
|
|
|
+ else:
|
|
|
+ return value
|
|
|
+
|
|
|
+ def __set_lcd_brightness(self):
|
|
|
+ pass
|
|
|
+
|
|
|
+ ############################## Methods public ##############################
|
|
|
+
|
|
|
+ def change_I2C_port(self, SDA_Pin, SCL_Pin):
|
|
|
+ pass
|
|
|
+
|
|
|
+
|
|
|
+if __name__ == "__main__":
|
|
|
+ pass
|
|
|
+
|