Clearing the terminal screen?

后端 未结 14 2508
隐瞒了意图╮
隐瞒了意图╮ 2020-12-29 07:03

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

14条回答
  •  再見小時候
    2020-12-29 07:58

    I have found that ASCII 12 make a Form feed, that is a new page. here is a wikipedia definition

    "Form feed is a page-breaking ASCII control character. It forces the printer to eject the current page and to continue printing at the top of another"

    The code is

    Serial.write(12);
    

    Arduino Terminate doesn't support the character but Putty a light open source telnet client can do it

    An Example of the code

    void setup() {
      Serial.begin(9600);//Initializase the serial transmiter speed
    
    }
    
    void loop() {
        //Code tested with Putty terminal
    
        Serial.write(12);//ASCII for a Form feed
        Serial.println("This is the title of a new page");// your code
    
        delay(500);//delay for visual
        }
    

提交回复
热议问题