Printing to the serial screen

Back in the old days with Basic, we were about to format a serial screen without line feeds and print data at various locations on the screen. Is there a Library available that offer more than just a standard out type of serial printer?

I hope I made some sense. :-[

1 Like

I guess what I need to know, are there any Terminal Emulations Libraries available.

1 Like

Not that I am aware of, but it seems useful I think. It is not so difficult to implement. You need to implement (a subset of) http://ascii-table.com/ansi-escape-sequences-vt-100.php of http://www.termsys.demon.co.uk/vtansi.htm

1 Like

Thank you.

1 Like

This works:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  String OFF = "\033[0m";
  String BOLD = "\033[1m";
  
  Serial.print(BOLD);
  Serial.println("Hello World");
  Serial.print(OFF);
  Serial.println("Goodbye");
  while(1);
}

Note \033 is the octal representation of the ESCape character. So a list of predefined strings and could do (part of) the job.

Super Thank you, this will work greatly!!!

Could also be done with #define

#define OFF "\033[0m"
#define BOLD "\033[1m"

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  Serial.print(BOLD);
  Serial.println("Hello World");
  Serial.print(OFF);
  Serial.println("Goodbye");
  while(1);
}

FYI I only tested it with putty on a windows platform.

What kind of device you want to "control"? Do you still have such a nice green VT100 terminal? sigh those good ol' days :slight_smile:
If you're makeing a VT100.h file with all those codes let us know!

Also interesting is "a class VT100" could look like ...
http://www.koders.com/c/fidEFB4129DD0634E618A381E5E63E0FF9F774529C8.aspx