Correct array type and SDFat saving.

Here is a minimal sketch to show the only way I understand to save my values to SDcard.

  file.print("millis");
  file.println();

So, we need to trace backwards to see what this is doing. file is an instance of the SdFile class, as shown here:

// log file
SdFile file;

According to SdFile.h:

class SdFile : public SdBaseFile, public Print {

This means that the SdFile class derives from the Print class, which is the same class that Serial and a number of other classes derives from.

What it means is that SdFile knows how to convert ints, floats, longs, and a number of other types to strings, for writing to the file.

I would like to use a for loop instead of the redundant write and print statements.

Why? Put all that code in a function, and call the function. Copying all the values to an array so that you can iterate over the array would require nearly the same number of statements. If the variables were all of the same type, that might make sense. Since they are not, it does not.