This is where we can add other cool sensors to our Arduino. Remember analogRead is really a voltage comparator.
Photresistors change value depending on light level, while thermistors change based on temperature. Both can be used in the same way. The circuit to the right shows the circuit diagram you could use with either of these. You'll notice that there is a variable resistor and a fixed resistor both hooked up to your analog pin. For a fixed resistor try 10k ohms.
The circuit below is the same one we used for the potentiometer circuit. Again, we need an LED in digital pin 13. Set up the Arduino with the circuit and the program and answer the questions below.
Now play with your circuit. Find the maximum and minimum values. Write these down. Use these as the minimum and maximum values for a map command (see the potentiometer lesson). Something like:
This will then adjust the flash rate to precisely match the light level. Next change this to fade an LED based on brightness.
Note, all of this could be done with a thermistor. So that rather than light level, temperature controls things. Picture a fan that kicks on if temp gets to high. Or maybe you set up the tri color LED to be red when it's hot and blue when it's cold. It won't be the first time something like this has been done.