Serial.println(s4);
jiyi1[i]=s1; // Save the read servo value to the array sequentially
jiyi2[i]=s2;
jiyi3[i]=s3;
jiyi4[i]=s4;
i++; //i value plus 1
j=i; // assign the last value of i to j
delay(100);
Serial.println(i); // on the serial monitor, print out the value i
}
}
if(z2==1) // if the left joystick key is pressed
{
delay(10);
if(z2==1) // judge again if the left key is pressed
{
i=0; // assign i to 0,prepare for the next memory
pos1 = myservo1.read(); // memorize the angle value of 4 servo posture
pos2 = myservo2.read();
pos3 = myservo3.read();
pos4 = myservo4.read();
for(int k=0;k<j;k++) // loop for j times, perform all actions saved.
{