top of page
Search

Week 9 August 14 - 21

Throughout the break, I was able to start working on the GUI for the software. For this I will be using the TKinter library that is included with python. This library allows me to create a window with buttons and displayed values. First, Jacob and I first designed what we wanted to see in the GUI in terms of the button placement and labels being used. As a working idea, I drew a quick sketch of the intented design.



To do this, the TKinter library is imported and instantiated as the object main_window. This is down using the following code.



This creates an object of the tkinter library and creates a “blank canvas” for the GUI with the title “Remote Controlled Microphone Stand”.


Next, the labels of the GUI are instantiated with as an object of Label(). Then the label is placed in GUI in a particular location using the grid() method of the Label class. This grid method places objects of the GUI into a grid of rows and columns. In order to know where the labels and buttons will be placed the concept diagram of the GUI is split into rows and columns. This allows us to see exactly where these objects will be placed in the GUI window.



For example, the label for the chassis control buttons that is placed above the buttons is given the grid location of row 0 and column 1.



The process for the buttons is similar to the labels except the object is created from the Button() class. It is also given a location in the grid so that it can be placed properly. The following figure shows the creation of the forward button and where it is placed in the grid.



In order to display the values of the motor positions, a label is created with an empty string. A function will be explained in further detail in a later post that will change the value of the label’s text and allow the program to display the values.



Finally, the function mainloop() is used to allow the GUI to constantly loop and react to new inputs from the user.



Here you can see the working GUI. This will be updated later with improved graphics but for now this allows us to use the main functionality of the GUI.



 
 
 

Comments


bottom of page