Write an application that interfaces a user with input and/or output device(s) on a board that you made.
python programing definition: Python is a general-purpose interpreted, interactive, object-oriented, and high-level programming language. It was created by Guido van Rossum during 1985- 1990. Like Perl, Python source code is also available under the GNU General Public License (GPL). This tutorial gives enough understanding on Python programming language.
pip definition :PIP is a package manager for Python packages, or modules if you like
here i would like to use python as programing language to program interface which can help to control cold room remotely. my interest to use DHT11 sensor as in put and proting its real time deta on graph . this push is me to install some python modules or libraries like
matplotlib,numpy and pandas
tiknter :is the de facto way in Python to create Graphical User interfaces (GUIs) and is included in all standard Python Distributions. In fact, it's the only framework built into the Python standard library.
bello this code i used to provide my interface to control the sound of busser on my boardimport serial import tkinter as tk serialPort = 'COM8' # change this to match your Arduino serial port serialBaud = 9600 def sendChar(char): ser = serial.Serial(serialPort serialBaud) ser.write(char.encode()) ser.close() root = tk.Tk() root.title("CONTROL BUZZER WITH TKINTER UI AND ESP32") buttonOn = tk.Button(root, text="Turn On", command=lambda: sendChar('H')) buttonOn.pack() buttonOff = tk.Button(root, text="Turn Off", command=lambda: sendChar('L')) buttonOff.pack() root.mainloop()
interface visiualiation
Arduino code to read searial pot and send the code on my mcu esp32 for interation between my UI and development board
const int buzzerPin = 25; int incomingByte; // a variable to read incoming serial data into void setup() {git // initialize serial communication: Serial.begin(9600); // initialize the LED pin as an output: pinMode(buzzerPin , OUTPUT); } void loop() { // see if there's incoming serial data: if (Serial.available() > 0) { // read the oldest byte in the serial buffer: incomingByte = Serial.read(); // if it's a capital H (ASCII 72), turn on the LED: if (incomingByte == 'H') { digitalWrite(buzzerPin, HIGH); } // if it's an L (ASCII 76) turn off the LED: if (incomingByte == 'L') { digitalWrite(buzzerPin, LOW); } } }