Hello!
I am trying to fill an array with 600 values to make a custom plot to display later. I want to make this values from different straight lines and i have made several for statements to fill it up, but when I print the array it is all filled with zeros, what am I doing wrong?
unsigned int Array[600];
void setup() {
// put your setup code here, to run once:
Fill_array();
Serial.begin(9600);
}
void loop() {
for (int t = 0; t < 600; t++) {
int plot = (Array[t]);
Serial.print(plot);
}
}
void Fill_Array() {
for (int t = 0; t == 170; t++) {
int calc = -0.35 * t + 200;
Array[t] = int(calc);
}
for (int t = 171; t == 256; t++) {
float calc = 0.35 * t + 50;
Array[t] = int(calc);
}
for (int t = 257; t == 341; t++) {
float calc = -0.8 * t + 354;
Array[t] = int(calc);
}
for (int t = 342; t == 426; t++) {
float calc = 0.12 * t + 29;
Array[t] = int(calc);
}
for (int t = 427; t == 511; t++) {
float calc = -0.38 * t + 232;
Array[t] = int(calc);
}
for (int t = 512; t == 600; t++) {
float calc = -0.23 * t + 166;
Array[t] = int(calc);
}
}