Charles Tritt / Mbed OS 21_SerialPass_v5
Committer:
CSTritt
Date:
Wed Oct 13 13:08:42 2021 +0000
Revision:
115:6ba84689e2c9
Child:
116:8990686eedf5
Not working. Causes runtime error.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
CSTritt 115:6ba84689e2c9 1 /* File: clrTerm.cpp
CSTritt 115:6ba84689e2c9 2
CSTritt 115:6ba84689e2c9 3 This function uses ANSI/VT100 escapse sequences to clear the terminal.
CSTritt 115:6ba84689e2c9 4
CSTritt 115:6ba84689e2c9 5 Created by Dr. C. S. Tritt
CSTritt 115:6ba84689e2c9 6 Last revised: 10/13/21 (v. 1.0)
CSTritt 115:6ba84689e2c9 7 */
CSTritt 115:6ba84689e2c9 8 #include "mbed.h"
CSTritt 115:6ba84689e2c9 9
CSTritt 115:6ba84689e2c9 10 void clrTerm(Serial *termPort){
CSTritt 115:6ba84689e2c9 11 const char ESC = 27; // Define escape character for escape sequence.
CSTritt 115:6ba84689e2c9 12 termPort->printf("%c[2J%c[H", ESC, ESC); // ANSI/VT100 clear screen/home.
CSTritt 115:6ba84689e2c9 13 }