OK, so I have 3 arrays of 10 values. I wish to be able to change through these arrays with the press of a button, but I'm having trouble changing the arrays.
I have in my code, the variable "currarray", which is the current array. I also have 3 other arrays, array1[10], array2[10] and array3[10]
Somehow, I need to put any of those 3 arrays, into currarray?
For example, I tried:
byte currarray[] = array1[];
However, I get error messages.
I also tried byte currarray = array1;
Still didn't work.
A snippet of my code:
byte array1[10] = {36, 41, 43, 44, 46, 48, 49, 51, 53, 55};
byte array2[10] = {35, 47, 54, 55, 57, 59, 60, 61, 62, 64};
byte array3[10] = {48, 60, 62, 63, 65, 67, 69, 70, 72, 74};
if (digitalRead(BUTTON_1) == LOW){
if (currarray[] == array1[]){
currarray[] = array2[];
digitalWrite(18, HIGH);
digitalWrite(17, LOW);
digitalWrite(19, LOW);
}
if (currarray[] == array2[]){
currarray[] = array3[];
digitalWrite(19, HIGH);
digitalWrite(18, LOW);
digitalWrite(17, LOW);
}
if (currarray[] == array3[]){
currarray[] = array1[];
digitalWrite(19, LOW);
digitalWrite(18, LOW);
digitalWrite(17, HIGH);
}
}
How would I go about doing this?
Regards