Hey! I am using 128x64 oled display with Adafruit_SSD1306 library.
Whenever i try to use this algorithm if I write display.print("something") , my code get stuck.
Without this algorithm display work perfectly.
I think this problem might be about sketch memory or oled buffer...
My sketch memory is %99

.
int sample=40;
int maxsample=50;
float alt[51];
float tim[51];
## LOOP FUNCTION
float tempo=millis();
for(int i = 1 ; i <= maxsample ; i++){
alt[(i-1)]=alt
;
tim[(i-1)]=tim;
};
alt[maxsample]=altitude; //altitude is variable from pressure sensor (pressure sensor works fine)!
tim[maxsample]=tempo;
float stime=tim[maxsample-sample];
float N1=0;
float N2=0;
float N3=0;
float D1=0;
float D2=0;
for(int i = (maxsample-sample) ; i < maxsample ; i++){
N1+=(tim-stime)*alt;
N2+=(tim-stime);
N3+=(alt);
D1+=(tim-stime)*(tim-stime);
D2+=(tim-stime);
};
float vario=0; // reset old value
vario=1000*((sample*N1)-N2*N3)/(sample*D1 - D2*D2); //set new value