I am trying to make a motion sensor with infrared emitter and detector from radioshack. Schematic attached. The thing is that i made a code to read the values of the sensor and it is reading crazy values. It is not doing nothing at all wen i aproach something to the sensor. I dont know if it is the code or the circuit. This is the code:
int sensor = 10;
int var = 0;
var = analogRead(sensor);
Someone told me that i have to use the map statement, but every examples that i had seen are for calibration.
Any response will be appreciated.