Analog light sensor outputs are strange?
hello all
ive bought light sensor module:
http://www.fasttech.com/products/0/10004903/1380700-photosensitive-diode-light-sensor-module
ive put gnd gnd, vcc 5 v on arduino , signal a1.
i have uploaded sketch it:
this results in output of 221 in serial monitor. nothing happens when put more light onto or cover up. when adjusting potentiometer on module jumps @ 1 point 249.
any ideas doing wrong?
ive bought light sensor module:
http://www.fasttech.com/products/0/10004903/1380700-photosensitive-diode-light-sensor-module
ive put gnd gnd, vcc 5 v on arduino , signal a1.
i have uploaded sketch it:
code: [select]
int sensorpin = a1;
int lightvalue = 0;
// light sensor
// setup routine runs once when press reset:
void setup() {
// initialize serial communication @ 9600 bits per second:
serial.begin(9600);
}
// loop routine runs on , on again forever:
void loop() {
// read analog input on analog pin 2 (the light sensor):
lightvalue = analogread(sensorpin);
// print out value read:
serial.print("the lightvalue ");
serial.println(lightvalue);
delay(500); // delay in between reads stability
}
this results in output of 221 in serial monitor. nothing happens when put more light onto or cover up. when adjusting potentiometer on module jumps @ 1 point 249.
any ideas doing wrong?
the photo shows electronic brick 2 outputs, 1 analog, 1 digital , 4 pins.
which output pin connecting to??
which output pin connecting to??
Arduino Forum > Using Arduino > Sensors > Analog light sensor outputs are strange?
arduino
Comments
Post a Comment