# Digistump Wiki

### Site Tools

oak:tutorials:photocell

# Differences

This shows you the differences between two versions of the page.

 oak:tutorials:photocell [2016/03/22 21:51]jwhendy oak:tutorials:photocell [2016/03/22 21:53]jwhendy Both sides previous revision Previous revision 2016/03/22 22:00 jwhendy resistor color code wrong2016/03/22 21:53 jwhendy 2016/03/22 21:51 jwhendy 2016/03/22 21:45 jwhendy 2016/03/20 19:04 jwhendy created 2016/03/22 22:00 jwhendy resistor color code wrong2016/03/22 21:53 jwhendy 2016/03/22 21:51 jwhendy 2016/03/22 21:45 jwhendy 2016/03/20 19:04 jwhendy created Last revision Both sides next revision Line 3: Line 3: [[http://​digistump.com/​wiki/​_media/​oak/​tutorials/​photocell.png|{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​photocell.png?​400}}]] [[http://​digistump.com/​wiki/​_media/​oak/​tutorials/​photocell.png|{{http://​digistump.com/​wiki/​_media/​oak/​tutorials/​photocell.png?​400}}]] - In this lesson, we will connect a photoresistor to the Oak. A photoresistor is simply ​a potentiometer (a variable resistor) ​where light is acting ​to turn the knob. When there is a lot of light, the resistance drops; with low light, the resistance is higher. Using this property, we can send a voltage through a photoresistor,​ measure the resistance via a change in voltage, and obtain a value for how much light is shining on the photoresistor. + In this lesson, we will connect a photoresistor to the Oak. A photoresistor is like a potentiometer (a variable resistor) ​except ​light is acting ​instead of a knob. When there is a lot of light, the resistance drops; with low light, the resistance is higher. Using this property, we can send a voltage through a photoresistor,​ measure the resistance via a change in voltage, and obtain a value for how much light is shining on the photoresistor. ===== Components ===== ===== Components ===== Line 117: Line 117: ​ - This code simply ​reads ''​A0'',​ stores the number it obtain in the variable called ''​light'',​ sends it ot the computer via serial, and then pauses for 0.25 seconds. ​ + This code reads ''​A0'',​ stores the number it obtain in the variable called ''​light'',​ sends it ot the computer via serial, and then pauses for 0.25 seconds. ​ Using serial, the output will look like this as you cover and uncover the sensor: Using serial, the output will look like this as you cover and uncover the sensor: