Clearing Terminal Screen with USART

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Is it possible to clear the terminal screen (Hyperterminal/Br@y's) with USART? What charater(s) do you have to send?

Thanks,
Andy

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It depends on what terminal emulation mode it set to.

IIRC For ANSI it's "[2J" (ESC is ASCII value 27).

putchar(27);
putchar('[');
putchar('2');
putchar('J');
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Depending what terminal type they are simulating you will need to get a copy of their escape sequences. This should let you clear the screen, move the cursor, change text colour etc.

Haven't played with that for many years. :) Try in VT100 or ANSI mode and get a copy of the escape sequences, I should have some info somewhere but it has been some 10 years since I used them.

edit beaten by a clog lenght... :)

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

In the good old days it was just Ctrl-L which would be:

putchar(12);

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
In the good old days it was just Ctrl-L which would be:

putchar(12);


... which is ASCII for FeedForm. Should roll out a sheet of paper off your teletype, and start with a clean new one. Add putchar(7) for a nice "cling".

JW

PS. Bray's is highly unsuitable for this kind of job, and hypoterminal is not the best one around. Try TeraTerm for this particular purpose.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think that a on its own will leave the cursor at the bottom of a scrolling screen.
VT52s (including HyperTerminal's emulation of VT52s) work with H (form-feed, cursor home)

Nigel Batten
www.batsocks.co.uk

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0