Clearing the terminal screen?

后端 未结 14 2538
隐瞒了意图╮
隐瞒了意图╮ 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

    Another kick at the can:

    void setup(){     /*123456789 123456789 123456789 123456789 123*/
      String newRow="\n|________________________________________";
      String scrSiz="\n|\n|\n|\n|\n|\n|\n|\n|\n|\t";
      Serial.begin(115200);  
           // this baudrate should not have flicker but it does as seen when
           // the persistence of vision threshold is insufficiently exceeded
           // 115200 baud should display ~10000 cps or a char every 0.1 msec
           // each 'for' loop iteration 'should' print 65 chars. in < 7 msec
           // Serial.print() artifact inefficiencies are the flicker culprit
           // unfortunately '\r' does not render in the IDE's Serial Monitor
    
      Serial.print( scrSiz+"\n|_____ size screen vertically to fit _____"  );
      for(int i=0;i<30;i++){
         delay(1000); 
         Serial.print((String)scrSiz +i +"\t" + (10*i) +newRow);}
    }
    void loop(){}
    

提交回复
热议问题