Interface and Application Programming

First I would like to clarify that I have never ever wrote a line of code in my life by myself, so this week assignment was challenging but also very exciting for me.

 I made a light sensor for input device week, and I wanted to use it.

I made a light sensor for input device week, and I wanted to use it.
I decided to use Processing and found this great video tutorial:

The first thing that I did is to understand Niel’s code at C.

Basically, if I got right, there are two values of high and low that are coming from the sensor, between those two values there are intervals of 1,2,3,4.

To make sure that I understood that there are two values I disabled the intervals of the 1,2,3,4.

 

I found an example that can read Serial, and I added a count er that will skip the 1,2,3,4 intervals.  
I defined the two values but, at that stage I was only able to express only the low values.

Later I realized how to express the high values

Then I found in the 3D examples a code of a rotating Grid. I managed to link between the Serial Code to the translation and the rotation of the grid, so the movement and the rotation of the grid is actually controlled by the light sensor.