Go Down

Topic: photo sensor (Read 440 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
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy