Answer the question
In order to leave comments, you need to log in
Arduino how to clear port monitor?
A small program has been written that displays numbers in 1 column:
1
2
3
and so on, how to make the monitor have only one number? Namely, after the output of one number N, it was deleted and the next number was displayed
Answer the question
In order to leave comments, you need to log in
No way to clear. Can be overwritten. For this, the Serial.print() method is used. At the end, you need to print the character 10 (0x0D) to return the carriage to the beginning.
Serial.println() at the end of each line automatically prints the combination of two characters 0x0D (Carriage Return) and 0x0A (Line feed)
If you connect to an arduino using a VT100-compatible terminal, you can use escape sequences. For example like this:
void setup()
{
Serial.begin(230400);
Serial.print("\x1B[?25l"); // Выключение курсора
}
void loop()
{
unsigned char input = (analogRead(A0) >> 6); // Чтение состояния входа Analog In 0 со сдвигом значения в диапазон [0..15]
Serial.print("\x1B[0;0H|"); // Курсор в позицию 0, 0
for (unsigned char n = 0; n < 16; ++n) { // Изображение шкалы
Serial.print((n == input) ? '+' : '-');
}
Serial.print('|');
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question