Hi, I'm using a GP2Y0A02YK0F IR sensor and just trying to get a basic read from it. The values it returns are between ~950 to 1023 regardless of the distance. I've tried using other pins (changing code respectively) but I'm unsure of what the problem could be. I've got my code below. Cheers ![]()
#define sensorIR A2
float sensorValue;
void setup(){
Serial.begin(9600);
}
void loop(){
sensorValue=analogRead(sensorIR);
Serial.print("Sensor Value: ");
Serial.println(sensorValue);
delay(150);
}