I am trying to get this function right.
I have an set of array's each with 33 numbers. I want pass a different of amount of arrays to a function to process them.
this is what i am doing now:
void actionscript2s(int arrayH[], int array1[],int array2[], int repeat){
int i = 0;
int temp = 0;
for (int x = 0; x < repeat; x++){
for (i = 0; i < servocount; i++)
{
Serial.print(" #");
Serial.print(i);
Serial.print(" P");
temp = (array1[i]+arrayH[i]);
Serial.print(temp);
}
finishoutput((array1[servocount]));
delay((array1[servocount]));
for (i = 0; i < servocount; i++)
{
Serial.print(" #");
Serial.print(i);
Serial.print(" P");
temp = (array2[i]+arrayH[i]);
Serial.print(temp);
}
finishoutput((array1[servocount]));
delay((array1[servocount]));
}
}
its for my octobot. I want to save some space and rewrite to be able to pass any number of arrays to and it have it process them x times
any help would be awesome.