Interface and applications

Last updated: May 2019

Group assignment

For this assignment, we tested the development of an interface that none of the 3 has used, one created by MATLAB

Board

Atmega328p



Because it is necessary to use aruino libraries to achieve data communication between the board and matlab, we decided to use a plate with atmega 328p as a microcontroller, in this case we use Italo's, you can see his repository for see the design and fabrication process



Arduino programming

As Italo has already burned bootloader, we can load the library that will allow access to matlab and transmit the data, you can download the code below






It is very important once the code is loaded to keep the FTDI connected, since the communication will be through this serial port



MATLAB GUI

Once these steps are done, we open matlab, once there with the GUIDE command we select to create a new GUI



In this extension .fig we will place the elements of the interzad, I will place 3 buttons and some texts that recognize the state of the variables that I will use



And I will also add a small logo





so you would see the interface



Then we proceeded to program the .m extension with the matlab language, this is where we define the functions of the elements of interest, in our case we place 3 buttons which will send text type data to the arduino and make the loop to turn the led physically, for that reason here we must define the outputs of the board as well as the port to which it is connected,



We used COM 30 because The board is connected in thhis port



In this handle we link the image with the axes5 of our GUI



Result

We make all the connections, connect the pins of the led to the output of the Atmega328p and give Run in matlab, we get the following result