Pages: [1]   Go Down
Author Topic: New library for controlling VT100/ANSI terminals  (Read 2881 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi folks,

Every so often a thread comes up asking how to position text on the SerialMonitor in a consistent place to get away from the pages of scrolling text.  The answer is always, "Use VT100/ANSI escapes" and "Use a real terminal emulator instead of SerialMonitor".  I'm still looking into upgrading SerialMonitor into a real terminal emulator, but I'd like to announce a convenient way to use VT100/ANSI escapes.

I've implemented a simple library for controlling ANSI/VT100/VT220 terminals over the serial port.  It delegates reading & writing to a Stream device, so it should be usable with SoftSerial or even I2C, although it has only been used with HardwareSerial so far. It's in a useful state, but there is still more to be done.

It's available at http://github.com/nottwo/BasicTerm

Currently implemented:
* clearing the screen
* positioning the cursor
* setting NORMAL, BOLD, UNDERLINE, BLINK & REVERSE character attributes
* setting foreground & background colors from the standard 8 color palette
* reading arrow & function keys (F1 - F4)

Still in the pipeline:
* expanded function key reading
* blocking reads & reads w/ timeout
* graphical character drawing

Here's an example of a top(1)-like Arduino status monitor sketch: https://github.com/nottwo/BasicTerm/blob/master/examples/StatusMonitor/StatusMonitor.ino

I'm interested in feedback on the library.  Thanks for checking it out &
feel free to let me know what you think!
Logged

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 126
Posts: 8474
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't got time to play with it bit it seems like a good idea, as you say we do get people asking to do this sort of thing.

______
Rob
Logged

Rob Gray aka the GRAYnomad www.robgray.com

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Could be a nice playground article !
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Could be a nice playground article !

Yes, that's a good idea.  I will write something up.

Just now I found an older library that went part of the way I'm headed with BasicTerm: http://arduino.cc/playground/InterfacingWithSoftware/Xterm
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 1
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,

Thanks for this fine library.

I am writing a emulator for an very old programmable calculator (Olivetti PROGRAMMA 101)
As in and output I need  a VT100 emulator running on a IMAC OS 10.7.
Does someone knows a good VT100 Terminal program (free) for the IMac?

Thanks,

Jan Kromhout
Hellevoetsluis-NL
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 212
Posts: 13531
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


Hoi Jan,

is this something that fit - http://lifehacker.com/5857046/the-best-terminal-emulator-for-mac-os-x -

[oostbrabant]
Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used the library to talk to an old NIXDORF BA63 POS 2x20 VFD customer display, connected to UNO Tx pin. I sent commands to the VFD thru Poderosa terminal emulator, since Arduino Serial Monitor is not VT100 compatible. No problems so far.Many thanks for your share.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 4
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I used the library to talk to an old NIXDORF BA63 POS 2x20 VFD customer display, connected to UNO Tx pin. I sent commands to the VFD thru Poderosa terminal emulator, since Arduino Serial Monitor is not VT100 compatible. No problems so far.Many thanks for your share.

I'm glad you found the library useful!

Do I understand correctly that you used Poderosa while you debugged your application since SerialMonitor doesn't support the VT100 escapes, and that the final application used the BA63 as an output device?

I'm not clear how a terminal emulator could help pass the display output to the BA63.

In any case, I welcome issues or pull requests on Github!
Logged

Pages: [1]   Go Up
Jump to: