Hi, guys!
I new to Arduino. I would like to read an IR LED with LED Reciever.
I can read values which come from the Transmitter (IR LED) while it is on.
When I use the delay, I can't read any value of the Reciever in the serial port.
I use the PULL-DOWN connection for my Reciever. ( 5V---longer leg, GND---10k--- analogPin)
My Code:
int led=8;
int sensor=A0;
int sensorValue=0;
// the setup function runs once when you press reset or power the board
void setup() {
Serial.begin(9600);
pinMode(led, OUTPUT);
pinMode(sensor,INPUT);
}
void loop() {
sensorValue=analogRead(sensor);
// Serial.println(sensorValue);
digitalWrite(led, HIGH);
Serial.println(sensorValue);
delay(1000);
digitalWrite(led, LOW);
Serial.println(sensorValue);
delay(1000);
}