Always remember to unplug your Arduino from the power source before modifying your circuit...
Create the pictured circuit by adding the following items to your working potWithSound circuit:
Connect the female end of a male-female wire connector to each leg of your LDR. Plug both wires into the breadboard in 2 separate 5-hole sections as pictured (pink and brown wires). Your photoresistor will hang away from the breadboard.
Next, remove the wires connecting the buzzer from the breadboard and plug the buzzer wires directly to the Arduino Uno board (GND and pin 3). This will free up some male/male connectors.
Add in the resistor and extra wires as pictured.
Plug your Arduino back into power. If your buzzer was changing tone when the potentiometer was turned, it should still do so. Edit your code to use pin A4 for the sensor pin and upload the code. It should now change tone when the light received by the LDR changes. Hold your hand over the LDR to make it dark, shine a light (phone torch works well) on the LDR to increase light level.
You can adapt any circuit we have built by using the input from one circuit with the output from another. The device we have created is superbly annoying as it will never stop making noise.
What are the inputs and outputs for the pictured circuit?
Are we using all of them in our code? Is there anything in the code that is not in the circuit?
If you have already added LEDs into your potWithSound circuit and coded them to come on and off according to the value read from the sensor, these should also still be working. If not, see if you can use the diagram and code sample on the nightLight page to add in an LED and get it working.
Think about useful applications for the components used so far and come up with your own circuit!