I have to work with a lot of numbers and I need an array that has all of the numbers from 0 to 1500. I want to have some kind of loop that can be defined int the "void setup" function, that will set up the desired array. I was thinking that I could make a "for" loop just keep adding all of the numbers until it hits 1500. Obviously that did not work. lol Bellow you will find one of my attempts to try this.
Any help would be great.
Thanks
const int MaxChars = 1500 ;
int temp[MaxChars+1] ;
int array[] = {1, 2 ,3, 4, 5} ;
void setup() {
Serial.begin(9600);
for ( int j = 0 ; j < MaxChars - 1 ; j++ )
{
int num ;
for ( int index = 0 ; index < MaxChars - 1 ; index++ )
{
temp[index] = num;
}
}
}
void loop() {
Serial.println(temp[1]);
for ( int i = 0 ; i < MaxChars ; i++) {while (i < MaxChars ) {Serial.println(temp[i++]);}}
delay(5000);
}