Servo control

After fixing the buffer size ... (how'd I miss that) ... and adding the Serial.print/println lines, it looks like this:

void parseBuffer() {
  Serial.print("String to parse: [");
  Serial.print(buffer);
  Serial.println("]");
  if (strlen(buffer) > 0) {
    int vals[] = {0, 0, 0, 0, 0};
    byte index = 0;
    char *token = strtok(buffer, ",");
    while (token) {
      vals[index] = atoi(token);
      token = strtok(NULL, ",");
    }
    // print vals
    for (int i = 0; i < 5; i++) {
      Serial.print(vals[i]);
      Serial.print(" - ");
    }
    Serial.println();
  }
}

And the result is this:

Initializing SD card...
initialization done.
String to parse: [90,2,90,2,5]
5 - 0 - 0 - 0 - 0 - 
String to parse: []
String to parse: [45,4,135,2,5]
5 - 0 - 0 - 0 - 0 - 
String to parse: []
String to parse: [135,2,45,4,5]
5 - 0 - 0 - 0 - 0 - 
String to parse: []
String to parse: [90,2,90,2,5]
5 - 0 - 0 - 0 - 0 - 
String to parse: []

Done reading file.