![]() Such as blank entry fields and value errors, this is due to the state-less-ness of the Some Exceptions have been made to prevent the app from crashing, The radio button selects the platform, as the serial object has different key phrasesįor Linux and Windows. """The function initiates the Connection to the UART device with the Port and Buad fed through the Entry Now we have our data, lets have our connect function, which starts a thread with a button click. ![]() This is put in a while loop so that the serial object.readline() is reading data continuously over time. Serial_data = serial_object.readline().strip('\n').strip('\r') The function has been put into a thread since the serial event is a blocking function. The filtered data into a global variable. """This function serves the purpose of collecting data from the serial object and storing It wouldn't harm us ) serial_data = ''įirst off lets get data and put this function in a thread. Gui.mainloop() has to be at the end of everything.ĭeclare a couple of global variables at the top since, this is not a class we might be better off adding a few global variables. If your GUI has to pop up, you will have to put it in a loop, set the geometry and run it in the loop, like in the picture. Once the object has been created, give it a title. Start of with the basics such as instantiating the GUI object. There is a whole world of applications for this such as reading sensor data, analytics, even industries use such a simple system to monitor there huge machines and I have taken a small chunk of their architecture to produce this project. An example Arduino code has also been put here to produce UART data. The main intention is to write a simple application which can read serial data from an external controller and display the analog data on a console and show progress bar increments. Tkinter has lots of inbuilt widgets which we have made use of in this tutorial.Īpart from learning widgets you will also come across multi-threading, Serial interface with Python, functions and simple data types. ![]() Tkinter can be used for a lot of purposes such as fast prototyping and for making testing applications and anything you can dream off. Here I have my first tutorial on Instructables with Python and Tkinter, Tkinter a simple GUI framework for generic purposes in Python. Python is quite an interesting language that has got everyone captive with its ease and top performance in terms of string manipulation, data types, structures and objects and what not.
0 Comments
Leave a Reply.AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |