Store value AnalogRead

Good afternoon, I want to read the values of a sine wave (analogRead) and store these values in a vector and then the return to compare with other values that gathered. How can I do?

We need more information. How many values will be read and stored? When comparing, what are you comparing? Are you comparing a current value from analogRead() to individual values stored in an array, or the average value from all previous values...what?

econjack:
We need more information. How many values will be read and stored? When comparing, what are you comparing? Are you comparing a current value from analogRead() to individual values stored in an array, or the average value from all previous values...what?

I will read some values do not know exactly how many, and then I will compare this with the values read from another sinusoid. In short I want to read values through analogRead and keep them somewhere to use later

What frequency is the sine wave?

KeithRB:
What frequency is the sine wave?

50Hz

ricperes:
I will read some values do not know exactly how many,

How about a rough idea? Ten, or ten thousand or ten million?

...R

Robin2:
How about a rough idea? Ten, or ten thousand or ten million?

...R

My idea to store values of some periods of the sine wave, maybe 50/100 values

ricperes:
I will read some values do not know exactly how many, and then I will compare this with the values read from another sinusoid. In short I want to read values through analogRead and keep them somewhere to use later

The limited RAM on the Arduino will determine how many values you can store. Your request has nothing unusual in it, there is documentation to cover everything. It is just a matter of putting it together like building blocks (that is mainly what programmers do):

  1. reading values
  2. timing
  3. adding values to an array
  4. comparing arrays

The only thing at all questionable is #4, the difficulty depends mainly on how detailed your design plan is. If it is already well thought out and defined, it may be easy. If not, you will end up doing a lot of playing around.

50 ints use 100 bytes of memory, so there isn't a problem there.

Honestly, I think you should explain the purpose of this exercise, or the thread might get sidetracked with all kinds of implementation details that don't pertain to what you actually need to do.

For example, there is a phase difference between arbitrary sine waves. How do you plan to handle that?