Week 15 - Interface and Application Programming


Interface and Application Programming - interface is a thing or circumstance that enables separate and sometimes incompatible elements to coordinate effectively and application programming is to perform a specific function to directly for the user or, in some cases, for another application program.

Assignment :

1) write an application that interfaces with an imput and / or output device

 

This week's assignment looks like have to build something that allows interface between two things. I am wondering what should I do for this week assignment.

Something triggered my mind when I heard of VPython, a programming language plus 3D graphics module called "visual" that makes it easy to create navigable 3D displays and animations. I was dying to try it out to see the results.

I decided to try it out with the phototransistor to communicate with the VPython.

I will need to program the phototransistor which I have already did it. The phototransistor must be linked to the PC using the PL2303 USB To RS232 TTL converter adapter to allow communication to Vpython.

Below is a picture of the phototransistor linking to the PC with the PL2303 USB To RS232 TTL converter adapter.

 

 

Now I have to download Vpython and together with visual. After downloading it, I read up on Vpython and tried to use a sample program to see whether it works.

Below is a screenshot of the Vpython icon with the sample program afther ammendment next to it.

 

Click here to view python file

 

After some trial and errors and doing some ammendments to the program, the program actually workout quite well. I am quite amazed with the results that I saw on my PC monitor. I actually see the 3D effect from the Vpython program.

Below is two pictures taken before and after of the phototransistor when light is applied from far (right) and near (left) with 3D visual effect on Vpython (visual).

 

Click here to view program file

 

Click on the picture to take a look of the video (phototransistor doing interface with Vpython).

 

 

After this assignment, it makes me more interested to learn more after I have completed the course. I am impressed with all these interesting things that I going through.