CSc 2010
Lab Assignment 5
Due: 8 April, 2010

There are two problems as before. The non-robot problem is an individual assignment and the robot problem is a team assignment.

  1. A non-robot problem (Should be submitted independently). Write a Python program, called Art.py, that draws a scene containing a house, a tree, and a sun on a Window labeled "Art". Each of the items should be labeled with the name and your name should be included at the bottom of the artwork. You should use different colors to fill the various shapes in the artwork. A sample drawing is shown below.

  2. A robot problem (Done as a team with one submission per team).

    Write a Python program named DisplayLight.py that reads the three Scribbler light sensor values and displays their normalized form in a graphics window in a bar chart format. The sensor values should be sampled every 1 second and the main program should contain a while-True loop. Use the following normalize function:

    Ambient = sum(getLight())/3.0
    
    def normalize(v):
      if v > Ambient:
        v = Ambient
      return (1.0 - v/(1.0*Ambient))*100.00
    
    A sample window is shown below:

    Note: The Window should have a width of 550 pixels and a height of 350 pixels. The height of the bars should be 100 pixels (the maximum normalized value). The green part should be proportional to the normalized value of the sensor value.

    Email your Art.py and DisplayLight.py files to raj@cs.gsu.edu by 11:59 p.m. on the assigned date.