WEEK 12 : Application and Interface programming



The above photograph is a paper prototype of the interface.


This week i decided to make the application interfacing part of my project . I used Processing + Arduino . The above photograph is a paper prototype of the interface.

The goal of the interface is to parse the RGB data being sent by the Arduino on the serial port .

This RGB values from the serial port will be logged into table to generate colour map .

The output of the grid of the RGB values will be stored in a CSV files for data archiving purposes



Incremental steps with which UI was built and tested are described here

The following is standard example whrere the LED is switchen on when the Mourse cursor in the designated area of the square . Following shows the code on the arduino and processing side . This example helped in establishing serial communication from processing to arduino

This is the tutorial on the following link : https://processing.org/tutorials/electronics/

The code for arduino has been edited for porting it onto Attiny44 . Notice the software Serial .

This program is create and toggle a button to switch on the LED on the LED board. This program helped to create a button which is could toggle .

This is the link where i found and used the tutorial : http://arduinobasics.blogspot.in/2013/04/serial-communication-tutorial-part-3.html

The photos illustrating the LED toggling the ON-OFF


I used this program to generate grid in certain rectangle i have yet to figure out a way to insert the value of RGB in the rectangle .I intend to make this grid scalable with respect of the size of the fruit. or hav size of the grid dynamically allocated . The following program shows code to generate the grid .

Generating grid of squares in processing

The following code writes data of an array in a csv(comma seperated value ) file . which has been generated the following functions . I looked around and people suggested a simple python script which could run and capture the data of the serial port into a text file . I burnt a AnalogInOutSerial example on the arduino and put a coiled piece of wire in the input to generate the numbers .

Arduino test Setup

This program is just burned on Attiny44 to generate dummy data , building on the existing python setup of file generation .

The python script

python succesfully importing and writing the data of the serial port into a text file

The text file which was generated by the python script

Personal Learning Milestones :

Learnt how to make an Front End interface which can communicate using arduino . Learnt how to use python to write data into a text file

The work of integrating these modules together is remaining .So a simple application could do all these things together

The orignal files can be found here