The Use of Light Sensor
From Microduino Wiki
Revision as of 02:33, 5 November 2015 by 1304410487@qq.com (talk) (→Experiment: Detect analog Brightness Value)
ContentsOutlineMicroduino-Light adopts photosensitive resistor. It uses a resistor that is based on semiconductor's photoelectric effect and is able to change along with the intensity of t the incident light. The photosensitive resistor is generally applied in light measurement, light control and photoelectric conversion. Specification
DevelopmentEquipment
Preparation
Experiment: Detect analog Brightness Value
#define sensorPin A0
int state;
void setup()
{
pinMode(sensorPin, INPUT);
Serial.begin(9600);
}
void loop()
{
state = analogRead(sensorPin);
Serial.print("state:");
Serial.println(state);
delay(100);
}
The stronger the light is, the greater the output value becomes. Therefore, you can build some projects controlled by light intensity change. Program Debugging
Application
Video |