Riyas P.K-Fab Academy 2016

Interface and application programming

The assignment for this week is to write an application that interfaces with an input and/or output device.


Application

I decided to make an interface for my input device which was transmit-receive version of the step response.After going through the class archive I decided to make the application using processing, since it was simple and very similar to arduino.There is several tutorial and examples in the processing site itself.This is one such tutorial for electronics : Processing-electronics tutorial

Processing is available across windows,mac OS and ubuntu.I decided to use it in ubuntu, first I downloaded and installed it.Since the step response circuit needed to connect to PC to interact with a serial communication is required, in my case FTDI is used.The advantage of processing is that it has a built in serial library.It can be accessed from Sketch->Import libary-> Serial.You should now see a line like import processing.serial.*; at the top of your sketch.

My idea was to show three different images by reading value from the input board.The images can be added by using Sketch->Add file.This was my code:

But there was a problem,the values keep changes each time when I connected the board,so I had to alter the code each time.s

In order to communicate with PC we have to specify our serial port and its speed, it is similar to that we used to call the python program : /dev/ttyUSB0 9600

The UI is simple,it is a window of size 1280*760 and it displays the images by reading the values from input board.


Working

In order to run the program the step response board is connected to PC via FTDI cable and RX and TX of the pin head is soldered to two copper boards.Then the program is run.Now, a window is pop up and shows the initial blank image since there is no input (value >3000),when I touched on right copper board the 'loading' image came up (value >2000 & value < 3000).And finally when I touched on the left copper board the 'fab academy' page apppeared (value >4500).The values can be seen in terminal and console of processing.

Here is a working video of it:

Your browser does not support the video tag.


Files

  • Interface-step response in processing format
  • Go back