I\'m reading data from 9 different sensors for my robot and I need to display them all steadily, in the same window so I can compare the values and see if any of the reading
There is no way to clear the screen but, a really easy way to fake it can be printing as much Serial.println();
as you need to keep all the old data out of the screen.
I made this simple function
to achieve this:
void clearscreen() {
for(int i=0; i<10; i++) {
Serial.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
}
}
It works well for me in the default terminal
the best way I can think of is using processing there are a few introductions on the net like displaying serial data, arduino graph and arduino radar
Since Arduino is based on processing its not that hard to learn
The Arduino serial monitor isn't a regular terminal so its not possible to clear the screen using standard terminal commands. I suggest using an actual terminal emulator, like Putty.
The command for clearing a terminal screen is ESC[2J
To accomplish in Arduino code:
Serial.write(27); // ESC command
Serial.print("[2J"); // clear screen command
Serial.write(27);
Serial.print("[H"); // cursor to home command
Source:
http://www.instructables.com/id/A-Wirelessly-Controlled-Arduino-Powered-Message-B/step6/Useful-Code-Explained-Clearing-a-Serial-Terminal/
You could just do:
Serial.println("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
or if you want:
for (int i=0; i<100; i++) {
Serial.print("\n");
}
/*
As close as I can get to Clear Screen
*/
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
}
void loop() {
Serial.println("This is Line ZERO ");
// put your main code here, to run repeatedly:
for (int i = 1; i < 37; i++)
{
// Check and print Line
if (i == 15)
{
Serial.println("Line 15");
}
else
Serial.println(i); //Prints line numbers Delete i for blank line
}
delay(5000);
}