use an array in another function

Hello,

I declared and stored an array in a function and I want to use it in another function but I have only the last value of the array which has the good value the other are zero.

#include <avr/io.h>
#include <avr/interrupt.h>
#define N 50
short i=0;
float Tech=5000 ;
void setup()
{Serial.begin(115200);
// INITIALIZE TIMER INTERRUPTS
cli(); // disable global interrupts

TCCR1A = 0; // set entire TCCR1A register to 0
TCCR1B = 0; // same for TCCR1B

OCR1A = 16000*Tech/64; // set compare match register to desired timer count. 16 MHz with 1024 prescaler = 15624 counts/s
TCCR1B |= (1 << WGM12); // turn on CTC mode. clear timer on compare match

TCCR1B |= (1 << CS10); // Set CS10 and CS11 bits for 64 prescaler
TCCR1B |= (1 << CS11);

TIMSK1 |= (1 << OCIE1A); // enable timer compare interrupt

sei(); // enable global interrupts}
}
ISR(TIMER1_COMPA_vect)
{
if (i<N)
{
test();
}

}
void loop()
{
}

void FillArray(float TheArray)
{
Serial.println(“full”);
//for(int p = 0; p < N; p++)
//{
Serial.println(TheArray[p]);
//}
}
void test()
{
float MyArray[N]={0};
short val=analogRead(A0);
MyArray*=float(val)/250;*
_ Serial.println(MyArray*);*_

* if(i==N-1)*
* {*
* FillArray(MyArray);*
* }*
*i++; *
}

. . . and that's why we ask you to use code tags when posting code.

You can't (or rather, you shouldn't) be doing Serial.print() in an interrupt service routine.

In the microcontroller world, arrays are big things. So big you don't ever want to move them.

char MyCharArray[]= "The quick brown fox jumped over the lazy dog.";

void setup() {
  Serial.begin(9600);
  Serial.println(MyCharArray);
}
void loop() {
}

In this example, the long string isn't copied to the println() function. The code just tells println() where it is and "go print that for me please."

For your array-manipulating functions, you should be passing the address of the array (the variable with the array's name) so that the function can work with that location instead of a copy of the data. This is why you also need to send the size of the array or have it stored somewhere else. The address of the data doesn't include any information on length.