Go Down

Topic: photo sensor (Read 407 times) previous topic - next topic

zhirantaha

when i plug 5v to the sensor it read too high i mean the degree but when i plug 3.3v it is normal
what is the problem??
Code: [Select]


int led = 13;
void setup () {
Serial.begin(9600);
pinMode(led, OUTPUT);
 
}
void loop () {
int value = digitalRead(A1);
int value1 = analogRead(A1);
Serial.println(value1);
if (value == LOW) {
digitalWrite(led, HIGH);

}
else
{
digitalWrite(led, LOW);
}
delay (1000)  ;
 
}

Magician

Your code doesn't make any sense to me, what you are trying to measure?

AWOL

Quote
what is the problem?

What is the sensor?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Go Up