Hi, guys!
How to analogRead from P3 properly?
I want to control LED intensity with Sharp IR distance sensor (2Y0A21). P2 and P4 works fine with sensor, but with P3 I have wrong results.
Seems, analogRead returns max value always and LED is always on.
int intensityPin = 3;
void setup() {
}
void loop() {
delay(300);
int intensity = analogRead(intensityPin);
intensity = map(intensity, 0, 1023, 0, 255);
analogWrite(1, intensity);
}