Interface and Application Programming
I will dig further to explain what I did to make last week's assignment work. I'm using the atom text editor with the "vim plugin" to try the feeling of using vim.
- installing node and npm. my Ubuntu had already node installed, but to use serialport, the npm site says that node has to be the legacy version.
- I installed
- The html file has only two
socket.on_message()is triggering request for looping.
- The javascipt file that will be ran by
node file.jsis the server-side program. Once the port is opened and starts to receive data, it waits for signals starting with '1234', which is a signature to know the start of the data. This part was coded in the microcontroller. As mentioned in last week, I used the difference to indicate the loudness of the input and change images.
I tried another platform using openframworks doing the same thing.
- I first cloned openFrameworks from the github repository.
- using linux, there is a guidance page for setting things up. It was straightforward with a few exceptions. The github repository lacks the Makefiles for building examples, and the project generator, the application for making a new project with all the necessary files needs to be cloned from a different repository. You will need to compile the project generator.
projectGenerator -o new_project_nameto make a empty project. Once this project generator is working and have one empty-example, you can modify the make files to build the other examples.
Serial Connection was not hard, there was a built-in function that handles everything. Here is the actuall implementation of
serial.setup("port",baud). It is first opening the port, then setting the baudrate. I like the way it is accessible to the raw implementaion, which there is a oppurtunity to learn in lower level. But it is still obscured when it comes to function calls or instructions and hard to identify which came from which 'include'. Same as avr instructions.