int led_p1[8] = {0x01, 0x02, 0x04, 0x08,
0x10, 0x20, 0x40, 0x80};
int led_p2[8] = {0x81, 0x42, 0x24, 0x18,
0x18, 0x24, 0x42, 0x81};
int led_p3[8] = {0xFF, 0x00, 0xFF, 0x00,
0xFF, 0x00, 0xFF, 0x00};
int led_pattern[8] = {};
int pattern_idx = 0;
// select pattern for now
switch(pattern_idx)
{
case 0:
led_pattern = led_p1;
pattern_idx++;
break;
case 1:
led_pattern = led_p2;
pattern_idx++;
break;
case 2:
led_pattern = led_p3;
pattern_idx = 0;
break;
}
I tried doing the above, I am going to loop round idx, copying a new sequence into the led_pattern, then loop round that, come back, get the next one.
I found a method to pass a whole array using a vector here; C++: copy array
But vectors (I believe) don't work on the compiler I am using (avr-gcc/c++)
How can I implement this within C++? I know in python the below would work, I can assign an array to another variable, and it "clones" it.
Thanks