phototransistor detecting led

Does that do more than create a not-inverted signal? (Does it do that?) Not that it isn't an improvement, if that's what the re-wiring is for... but I wondered if there were other advantages? (Assuming my guess is right as to one of them is!)

But!... to address the original question...

a) Have you somewhere in your code done something to re-program the analog pin for something else? (They can be treated as "ordinary" DIO pins... and set as outputs. In which case, you MAY have fried that "input" by now.)

b) Try this... test the input as follows... The first resistor is to "protect" things, in case your analog input has somehow become low impedence... as it would be it it is being turned into an output.

Connect a 10k (or so) resistor to the analog input. From the other end of that go to the wiper of a potentiometer... almost anything will do... about 10k by choice. Connect the top and bottom of the pot to 5v and 0 volts. Try the pot at different settings. What do you see with a voltmeter? What do you see if you "look" at the pin with software.

Should shed light on things...?

(You can get around the need for a pot with a pair of resistors in series across 5v to 0v... again, about 10k, and for a "wiper", just use a flying lead and touch top (5v), bottom (0v) and "the middle"... where the resistors connect to each other.)