Solved - the problem was failed solder on GND pin
Hi everyone,
I'm trying to get a photoresistor working on my Teensy3.6. This is the code:
When I place my finger on the photoresistor, so there's no light, the value should be 0.
When I place the torch of my phone in front of the photoresistor, the value should be (and is) 1023.
But when I place my finger on the photoresistor, I got +/- 1015 as value. This is far from what it should be and the values are for too close to be able to do something with it.
When I disconnect the photoresistor, so there's nothing in the analog port, the value that I get is around 970. Is that normal?
Can someone help me?
Thanks in advance!
Hi everyone,
I'm trying to get a photoresistor working on my Teensy3.6. This is the code:
Code:
void setup() {
// put your setup code here, to run once:
pinMode(34, INPUT_PULLUP);
pinMode(33, OUTPUT);
digitalWrite(33, HIGH);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
Serial.println(analogRead(34));
delay(200);
}
When I place my finger on the photoresistor, so there's no light, the value should be 0.
When I place the torch of my phone in front of the photoresistor, the value should be (and is) 1023.
But when I place my finger on the photoresistor, I got +/- 1015 as value. This is far from what it should be and the values are for too close to be able to do something with it.
When I disconnect the photoresistor, so there's nothing in the analog port, the value that I get is around 970. Is that normal?
Can someone help me?
Thanks in advance!
Last edited: