Hello everyone, my name is Yabed and I'm learning how to MAKE (almost) anything

Fab Academy 2014

>> Week 15, May 7: Interface and application programming

Write an application that interfaces with an input &/or output device

 

I keep learning everyday. I don’t have time to rest. Now I’m going to learn something about graphical interfaces so that the user, from his / her PC screen, may be able to control a device controlled by a microcontroller.

For this assignment, I implemented a graphic interface to control the RGB Led shield developed in Assignment 12, which, in turns, is controlled by a fabduino.

The work flow starts by designing the interface screen by means of Qt Designer software. Then, the file obtained should be translated to python language. This is obtained by means of "pyuic4" command, included in python "python-qt4-devel" pack. Finally, a file is coded in python to link the graphic interface to the hardware through the serial connector.

 

Designing the screen in Qt Designer

The generated file has an .ui extension.

Then, we translate the .ui file to a .py (python) file. For this purpose, the following command should be executed in the Ubuntu terminal:

pyuic4 xxxx.ui -o xxxx.py

Replace "xxxx" by the file name being used.

The process does not generate any message; the generation of the new file is verified by means of the .py extension.

In the case the command does not run, the python package "python-qt4-devel" should be installed.

Finally, python file is coded so that it be able to communicate the graphic interface to the hardware (which was made and programmed in Assignment 12, output device) to reply to the variables defined by the used by means of the interface.

Below, a video where you can see the LedRGB shield, the Fabduino card and the graphic interface working together.

 

 

For a correct functioning, the name of the used port should be correctly identified by means of the FTDI cable that connects to the Fabduino and include it in the python code.

In order to execute the interface, you should introduce the following command in the Ubutu terminal:

python xxxx.py

xxxx should be replaced by the generated file name.

 

Final Note: to implement the graphic interface, the tutorial published in the following link was used:

http://cozorello.blogspot.com.es/2013_07_01_archive.html

 

scroll up