title: C++ code for meArm arduino robot doesn't work
body: <p>I'm having some issues with this code for meArm arduino robot.
  It should ask the user to input the values for the angles of the servo motors and rotate them, however it only does so the first 2 times and then stops working.<br />
  Is there any error in the code?</p>
  <pre><code>#include &lt;Servo.h&gt;
  
  int angle1;
  int angle2;
  int angle3;
  
  Servo s1;
  Servo s2;
  Servo s3;
  Servo s4;
  
  const int BUFFER_SIZE = 100;
  char buf[BUFFER_SIZE];
  
  void setup() {
    Serial.begin(9600);
    
    s1.attach(10);
    s2.attach(9);
    s3.attach(8);
  
    s1.write(90);
    s2.write(0);
    s3.write(0);
  }
  
  void loop() {
    Serial.println(&quot;Set the angle for s1 servo&quot;);
    while (Serial.available() == 0) {};
    angle1 = Serial.readBytesUntil('\n', buf, BUFFER_SIZE);
  
    Serial.println(&quot;Set the angle for s2 servo&quot;);
    while (Serial.available() == 0) {};
    angle2 = Serial.readBytesUntil('\n', buf, BUFFER_SIZE);
  
    Serial.println(&quot;Set the angle for s3 servo&quot;);
    while (Serial.available() == 0) {};
    angle3 = Serial.readBytesUntil('\n', buf, BUFFER_SIZE);
  
    ForwardKinematics(angle1, angle2, angle3);
  }
  
  /**
   * Rotates the servo motors by the given angles.
   * 
   * @param angle1 The angle by which the servo s1 is rotated.
   * @param angle2 The angle by which the servo s2 is rotated.
   * @param angle3 The angle by which the servo s3 is rotated.
   */
  void ForwardKinematics(int angle1, int angle2, int angle3) {
    s1.write(angle1);
    s2.write(angle2);
    s3.write(angle3);
    delay(500);
  }
  </code></pre>