Exercise 1: We used photo-resistors to regulate the pulse in voltage to the speaker. You can see it demonstrated best with the flashlight in the video below. Here is a link to the code.
Exercise 2: We took the tone a little bit further to play the Super Mario Brothers theme music. The melody first plays level one music and then plays level two… it continues to rotate between the two as long as it is on. Here is a link to the code.
Exercise 3: In this exercise we used a pressure sensor to regulate the rotation of the servo. Here is a link to the code.