Hello. I am trying to use a 2D array to have an array of size 5 which holds arrays within. I have a function where i try to move the arrays to the next position:
ex: {{7,7,7,7},{4,4,4,4},{2,2,2,2},{3,3,3,3},{5,5,5,5}}
after the assignment where i add a new array and move all the others down one place would be:
{{8,8,8,8},{7,7,7,7},{4,4,4,4},{2,2,2,2},{3,3,3,3}}
but I am having trouble assigning these arrays and receive the error "invalid array assignment"
const int numValues = 4; // How many values in an array
const int trackingArraySize = 5; // how many arrays of values to keep
int trackingArray[trackingArraySize][numValues];
int arrayOfNewValues[numValues];
void loop() {
// arrayOfNewValues array fills up with new values in a for loop..
for (int i=0 ; i< numValues ; i++)
arrayOfNewValues[i] = //Value in from sensor//
valueTracker(arrayOfNewValues);
}
void valueTracker(int newValues[]) {
for (int i=trackingArraySize-1 ; i >= 0 ; i-- )
trackingArray[i] = trackingArray[i-1]; /// ERROR here: "invalid array assignment"
trackingArray[0] = newValues;
}