This week assignment is about making an interface with an output or input made by ourselves. In my case I am going to use the hall sensor in a skullcap (for more information about it look at Final Project section) and Matlab software.
Matlab is a mathematical program specialize in matrices operations with several modules with functions that allow the user to do many operations in just a few lines of code. Eventhough I don’t have the program in my laptop, I went to UNI computer’s lab and did my assignment. Inside the program exist a set of commands that control the PC’s ports. The commands that were used are:
The program logic used inside the interface is pretty simple: choose the port, open it and keep reading until the program is closed.
In the other hand the board program just keep reading the hall sensor at the skullcap and send the data through asynchronous serial communication with a 300 ms delay between measurements.
Initially I thought that it was going to be a piece of cake, but in the tutorials I looked the Attiny44 was connected to the PC through the Arduino. The output was pretty rare… I only got “iiiiiyyyyyyyyyyyyyyyyyiiiyyyyyyyyy”. However, when I used he FTDI cable instead of the arduino the the values came clear. The communcation of the ATtiny have to be make without the arduino which, at least in appearence, works as a impedance that negates proper communication. One comment to make is that arduino IDE doesn't need an arduino to use the serial communication window.
The next video and photos show the performanace of the system. It is pretty similar to the Input Device Assignment but made by my self.