Interface and application programming
The Assignment for this week was to write an application that interfaces with an input &/or output device.
For this weeks assignment, I started looking at the process of using the Photo resistor / Phototransistor and termister (temperature sensor) as a switch to control things around.
I started by first building the light sensor referring to the board on the academy site. After building the board, I programmed it using the C-code from Prof. Neil. After programming it I had to make sure it worked, so I tested the board with the python program that Prof. Neil wrote. It worked perfectly, so I continued my quest of writing an interface for the board to control.
Being my first sample with little experience, I tried sourcing for help from colleagues and instructors' websites. I happened to land on Anna's tutorials on processing. As a beginner, I realized it was the program to start with, after going through some of the tutorials from the processing webpage.
In pursuit of my first my piece, I decided to try the example code from Anna. It worked out very well so I started with my code and succeeded in making it work at last. Not the way I expected but after some few try, I was able to make it work.
What the code is supposed to do:
I wanted the code to read the serial port and create a background if there is a device connected. If the answer was no!, no background will be created. The next step was to read the value of the serial port and draw a particular size of square upon detecting a specific rang of value and then fill the square with that rang of value.
Bellow are images showing the process: CLICK LINKS BELOW TO SEE VIDEOS
Board used:
board soldered:
board successfully programmed:
Example code from Anna:
My code operating in low value and high value mode:
Video of Anna's code in operation:
Video of My example code in operation: