Help with datalogger code

Hi, I am trying to set up my datalogger to monitor the charging of a 12v battery using a solar panel charge controller. I have the code for the voltage divider but can't see how to adapt the standard datalogger example, which reads three pins, to just reading one pin.(pin5) I also want to include a delay in the loop.
From example:

  // read three sensors and append to the string:
  for (int analogPin = 0; analogPin < 3; analogPin++) {
    int sensor = analogRead(analogPin);
    dataString += String(sensor);
    if (analogPin < 2) {
      dataString += ",";
    }

Any help appreciated as I am new to c having mainly used basic and long ago fortran

Try to avoid using big-S Strings. They chew up memory for no reason.

If you only want one sensor, then remove the for() {} loop. Just read the analog pin and do what you want with the value.

Ok, seems to be working now with all that removed.