Never tried using analogRead for PWM - does it work?
I know you have typed this code from memory which from my experience always leads to silly errors - couple of observations - to stand a chance pin should be A1 not 1 but I think you would have more success with pulseIn() (mandatory use of timeout parameter as if no change in signal code it will waste time waiting for one to arrive!!!) - however I am not a fan of this command due to it's "code blocking" side effect - far better to use Interrupts
Another pointer - repeated use of analog Read can lead to spurious readings - there is only one AD convertor - the analog pins are multiplexed to the single AD - the solution is to read any analog pin twice with a 5 millisecond delay between and only use the second read.
The first read forces the multiplexer to look at your desired pin, the delay allows voltage sabilisation and the second read will be a good stable reading
How do I know this - because I lost many brain cells and hours of my life before I found the solution!!
Projects have a habit of evolving and getting more complex, using puslseIn() (with timeout parameter set) for reading a few RC receiver pins to control some switches works well, if you then progress to more complex projects you will eventually find that using pulseIn() comes back to haunt you (code blocking) - using interuppts is a sure fire way of sucess with complex projects
See this link for a great tutorial and explanation - I have used a variant of Ryan's code for years