I got an optical sensor from inside of an old computer mouse and am trying to hook it up to an arduino nano. I decided to use a new IRED as the old one didn't work. The IR receiver seems to give no signal (only 0 appears in serial monitor).
My code is below and picture of my setup here (Imgur: The magic of the Internet)
What could I be doing wrong?
void setup() {
Serial.begin(9600);
#define pulseOutput 17
#define pulseInput 26
}
void loop() {
{
pinMode(pulseOutput, INPUT);
pinMode(pulseInput, OUTPUT);
}
int LEDState = analogRead(pulseOutput);
delay(100);
Serial.println(LEDState);
}