UKHeliBob:
int sentido_x[MAX], sentido_y[MAX], sentido_z[MAX], i, j;
float freq_x[MAX], freq_y[MAX], freq_z[MAX], tempo[MAX];
As MAX is 500 those arrays will use a large amount of memory. Which Arduino board are you using ?
Arduino uno, but im using local variable, so thats enough memory for this (that why its working if i dont put the function "calculos"). Do you think im using too much memory with this and it dont have memory enough to execute my function?