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 readings is off.
The problem I'm having with both Serial.print and lcd.print is that the values are constantly moving and I can't really have a good look at them while moving the robot.
I was thinking to call something like Serial.clear() before displaying anything else and that would just keep things steady and in one place, changing only the values.
From what I found so far, Serial.print(17,BYTE) for instance is no longer supported (Calling the ESC key).
So...for those with a bit more Arduino experience...what is the proper way to do this?
When using the bash shell, you can also clear the screen by pressing Ctrl + L .
To clear the screen in Visual C++, utilize the code: system("CLS"); The standard library header file <stdlib. h> is needed.
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/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With