- Sat Mar 04, 2017 4:20 pm
#193746
Hello!
I'm learning arduino on Sparkfun ESP8266 Thing Dev board.
I have connected photoresistor to the Thing using this example -
The code is simple :
Serial plotter screenshot :
Any ideas what I'm doing wrong?
I'm learning arduino on Sparkfun ESP8266 Thing Dev board.
I have connected photoresistor to the Thing using this example -
The code is simple :
Code: Select all
The problem is with the analog reading values - they are fluctuating when photoresistor is reading rooms lights and values looks more like a sinusoidal wave. When the sensor is covered and in the dark, the values are more linear.int LDR_Pin = A0;
void setup() {
Serial.begin(9600);
Serial.println("LDR Light Sensor | cactus.io");
}
void loop() {
Serial.println(analogRead(LDR_Pin));
delay(100);
}
Serial plotter screenshot :
Any ideas what I'm doing wrong?