First off read the How to use this forum
Because your post is breaking the rules about posting code.
Next you need to say what you want to do:-
i want to generate pulse and analog read pin A0 just when the wave rising
Edit:-
So you look at the input from the pin monitoring the input signal and use a variable to keep track of the last read value. When the last read value was a zero and the current value is a one then do the analog read.
This is called a state change and is one of the example coded in the IDE.