need help

hi

i want to generate pulse and analog read pin A0 just when the wave rising ! but i dont know what to do ??

#include "TimerOne.h"
int a;

void setup()
{
pinMode(10, OUTPUT);
Timer1.initialize(5000);
Timer1.pwm(9, 990);
}

void loop() {
}

void readsensor() {
a=analogRead(A0);

}

thank you
best regards

like this

New Bitmap Image (3).jpg

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.

sorry . i am noob . :confused:

can you explain more or an example ?

thank you .

can you explain more or an example ?

I told you and example is already in the Arduino's IDE.
Have you gone through these examples in you attempt to learn how to code?

Is this an X-Y Problem?