Go Down

Topic: print array serial print row by row (Read 220 times) previous topic - next topic

AWOL

Nearly three days, when a few simple experiments could have been tried and refined in a matter of minutes?
"Pete, it's a fool (who) looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.
I speak for myself, not Arduino.

UKHeliBob

OP - I can't believe that this thread has not yet reached a conclusion

Use a for loop to print each reading followed immediately by a space, comma, tab or whatever delimiter that you want.  After the for loop print a newline

Job done, assuming that you know how to copy the data from the Serial monitor to a file, Excel, whatever.
Please do not send me PMs asking for help.  Post in the forum then everyone will benefit from seeing the questions and answers.

evanmars

Something like this, maybe

Code: [Select]
for( int i = 0; i<16; i++)
  {
    data[i] = analogRead( A0 + i);
    Serial.print(data[i]);
    if (i < 15)
        Serial.print(",");
    else
        Serial.println("");
  }


or

Code: [Select]
for( int i = 0; i<16; i++)
  {
    data[i] = analogRead( A0 + i);
    Serial.print(data[i]);
    if (i < 15)
        Serial.print(",");
  }
Serial.println("");

Go Up