![]() |
Forum Index : Microcontroller and PC projects : CLS and puTTY and TeraTerm
Author | Message | ||||
VK2AHB Regular Member ![]() Joined: 28/07/2022 Location: AustraliaPosts: 51 |
I'm a newbie to the pico/MMBasic world, but started with BASIC in the 80's with a Sharp PC1211, then C=64. It sure has changed in 40 years! I'm amazed at the functionality crammed into such a small, cheap device! I've started with simple stuff, like reading RTC and temperature from bits I've been using with the Auduino Nano. Sure is interesting to compare the amount of code and libraries required for C++ against MMBasic! So I print Date, Time and temperature with a delay of 10 seconds, then issue the CLS command. My immediate problem is CLS in terminal mode. With the VGA monitor, it does as its asked, but in terminal, it keeps printing new lines. I'd appreciate help in what might be a trivial setting. Paul VK2AHB |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Hi and welcome. To erase the terminal, you need to send it the escape codes ESC[2J Erase the screen Somewhere in the recent past, there was a post with subs for many of the esc sequences that are commonly used. Jim VK7JH MMedit |
||||
lizby Guru ![]() Joined: 17/05/2016 Location: United StatesPosts: 3378 |
Mixtel90's VT100 library for the Micromite console PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed |
||||
TassyJim![]() Guru ![]() Joined: 07/08/2011 Location: AustraliaPosts: 6283 |
Thanks, I was almost back to there. I had a couple of pages to go! Jim VK7JH MMedit |
||||
Mixtel90![]() Guru ![]() Joined: 05/10/2019 Location: United KingdomPosts: 7937 |
Hi Paul, and welcome to the forum. :) I was confused by this originally, don't worry. :) The PicoMite has two output devices, one is a console (which supports ANSI escape codes) and the other is a graphic device. When you first boot up you are in console mode by default. Note that the two devices don't have to be two physical devices, they can be different displays on the same screen. Error and information messages are sent to the console. User output can be to either. Each device has its own commands to output text: The console uses PRINT, which puts ASCII characters in cells as expected. The graphic display uses TEXT, which draws text on a graphic screen at any location. CLS is actually a graphic command and means nothing to an ANSI console. This is where the ANSI sequence ESC[2J comes from. There are a lot of these sequences that work on the console. The link that Lizby has given is a library of quite a few useful ones that work on Tera Term. Mick Zilog Inside! nascom.info for Nascom & Gemini Preliminary MMBasic docs & my PCB designs |
||||
Martin H.![]() Guru ![]() Joined: 04/06/2022 Location: GermanyPosts: 1233 |
Const el$=Chr$(27)+"[" ' 'Your Program ' ' ' SUB tcls ' clear terminal screen PRINT el$;"2j"; home END SUB SUB home ' cursor top left PRINT el$;"h"; END SUB SUB at row,col PRINT el$;;STR$(row);"h";el$;STR$(col);"g"; END SUB Sub cur_off Print el$"?25l"; End Sub Sub cur_on Print el$;"?25h"; End Sub tcls= Terminal CLS home = Cursor to top left at positions the Cursor to row/column Cur_off / Cur_on hides the Cursor while redrawing the Screen Edited 2022-08-12 19:11 by Martin H. 'no comment |
||||
VK2AHB Regular Member ![]() Joined: 28/07/2022 Location: AustraliaPosts: 51 |
Thanks to all who replied, that was very helpful. Paul VK2AHB |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |