Beginners: please read this post and this post before posting to the forum.
0 Members and 1 Guest are viewing this topic.
void Move(int direction) { int time_position=0;//goes up to 8 direction=1; //if(direction==1) //{ unsigned int Rib_1_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Rib_2_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Rib_4_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Rib_5_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Bulk_Left[8]={33,33,33,33,33,33,33,33}; //} //sort through kinematics for one cycle while(time_position<8) { RIB_1_Fin_Left(Rib_1_Left[time_position]); RIB_2_Fin_Left(Rib_2_Left[time_position]); RIB_4_Fin_Left(Rib_4_Left[time_position]); RIB_5_Fin_Left(Rib_5_Left[time_position]); BULK_Fin_Left(Bulk_Left[time_position]); time_position++; } }
void Move(int direction) { int time_position=0;//goes up to 8 direction=1; if(direction==1) { unsigned int Rib_1_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Rib_2_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Rib_4_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Rib_5_Left[8]={33,33,33,33,33,33,33,33}; unsigned int Bulk_Left[8]={33,33,33,33,33,33,33,33}; } //sort through kinematics for one cycle while(time_position<8) { RIB_1_Fin_Left(Rib_1_Left[time_position]); RIB_2_Fin_Left(Rib_2_Left[time_position]); RIB_4_Fin_Left(Rib_4_Left[time_position]); RIB_5_Fin_Left(Rib_5_Left[time_position]); BULK_Fin_Left(Bulk_Left[time_position]); time_position++; } }
Of course, given the numbers you're giving me, you're probably going to run out of RAM really quick, unless you're using one of the huge AVR chips.
memcpy_P( array2, array1, sizeof( array2 ));
You may also want to check the size of your values - he says 'int' is 16 bits typically on AVRs...
How many of these 8-byte arrays do you have in total (including all sets of values)?
so lets say i initialize an array like this:unsigned int Rib_1_Left[8]={33,33,33,33,33,33,33,33};but then later i want the array to have some other random set of numbers stored:unsigned int Rib_1_Left[8]={133,23,33,43,23,83,93,133};without reinitiating it, how would i write that above line?if I just do:Rib_1_Left[8]={133,23,33,43,23,83,93,133};it gives me an error that says "expected expression before '{' token"i could of course do one liners like this that will work:Rib_1_Left[0]=133;Rib_1_Left[1]=23;Rib_1_Left[2]=33;but since i must have 16 arrays each of size 8 this would get extremely messy very fast