Serial.print

Hello,

I have Arduino serial screen data like

ax ay az gx gy gz mx my mz
ax ay az gx gy gz mx my mz
ax ay az gx gy gz mx my mz
. . . . . . . . .
. . . . . . . . .

but I want to format it like

ax ax......
ay ay......
az az....
gx gx....
gy gy....
gz gz....
mx mx....
my my....
mz mz....

I have tried several things like \t \n println ext. but I can't be successful.

Does someone have an idea?

canob:
Does someone have an idea?

Would it be too much to ask you to post your code?

Serial.println(ax); the println, adds the carriage return. I presume it means "line new".

So,
...

Serial.println(ax);Serial.println(ay);Serial.println(az);
Serial.println(gx);Serial.println(gy);Serial.println(gz);
Serial.println(mx);Serial.println(my);Serial.println(mz);

...

I suppose the data you have in a line today arrive one after the other and you want to print as you go in columns? As you don't have the second column when you print the first line, you can't ==> the arduino console does not let you move the cursor around you print a line and then go to the next no way to go back up

You would need to capture all the values in a matrix and then print but if it's continuous flow of data and not limited to say 10 values, then not possible because it would unlimited size

Unix was build by people reading and writing left to right and top to bottom... sometimes it shows, deal with it or use something different than a serial console to display the results (or turn your head 90 degrees :slight_smile: )

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile: