Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.
|
Forum Index : Microcontroller and PC projects : CLS missing on µMite
Author | Message | ||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Hi, it would be nice to clean the entire (visible) screen on the VT100 terminal. The good old "CLS" command doesn't work anymore... I tried several VT100 commands as Print Chr$(27);"[H"
Print Chr$(27);"[f" Print Chr$(27);"[2J" but I am not able to clean the entire screen! The first line will be always untouched and not deleted! Did anybody have an idea? (@Geoff: ...I think I remember that the CLS works on the MM on VGA, BAS *and* terminal window?) Thanks Frank |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2817 |
Hi Frank, If you are using Tera Term, then under the 'Edit' menu there is an option to 'Clear Screen'. Does what it says on the tin! Other console programs should have a similar feature. There is little meaning in having any graphical control with a MicroMite (including CLS) when you think about it. Let us know if this is a suitable solution for you! Regards, Phil For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
Lou Senior Member Joined: 01/02/2014 Location: United StatesPosts: 229 |
The CLS is handy when editing on chip, I also miss it. It was probably taken out for more room in the uMite for other features, maybe it will show up again on the 170 chip - only Geoff knows. WW's work around works but you have to grab the mouse. A work around from the keyboard is F4 then ESC key from the command prompt, that will clear it. Lou Microcontrollers - the other white meat |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Hi White Wizzard, you are right with the Teraterm option, but I need a CLS to print new values on the same position on the terminal window within a loop from the µMite program... I think it should be possible with any Teraterm-VT100 command. Frank |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2817 |
Hi Frank, Not knowing exactly what you are doing, if this 'displayed' value is considered necessary, why not use a cheap LCD to display it? The LCD concept is cheap, and reasonably well documented elsewhere on the forum. Yes I fully appreciate that it can be very useful to display data in a fixed position on a console display (very much so for debugging purposes), but would you really design a MicroMite solution to display data on a console? It would be very interesting to know more about you overall aim and what it is that you are 'building'. Please share if you wish too . . . Phil For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
psergiu Regular Member Joined: 09/02/2013 Location: United StatesPosts: 83 |
Since you are using an external serial terminal, the "clear screen" function is handled by your terminal. The official VT100 clear screen sequence is "<ESC> [ 2 J" so your Print Chr$(27);"[2J" should have cleared-it. This means your terminal software is not 100% DEC VT100 compatible. A built-in CLS command will just print "<ESC> [ 2 J" and will also not work on your terminal software. Also for people using other terminal types (VT52, DOS-ANSI, 3270, HPTERM, TEK ...) different escape codes for CLS are needed. And i don't think Geoff can fit the whole TermInfo/TermCap database in there So find a escape code that works on your particular terminal and make your own CLS. See here for some useful escape codes: http://www.termsys.demon.co.uk/vtansi.htm |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2817 |
Frank, I can confirm that psergiu's method of using: Print Chr$(27);"[2J" works with TeraTerm. Note that it clears the screen down to the current line. I guess you then need cursor positional control to place cursor at relevant location before printing your data. Will look at the link psergiu provided and play a little more . . . For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2817 |
Frank, OK got it working nicely with a little test program (and no LCD required!!!) x=0 ' used as a counter value that is displayed on the console window Do Print Chr$(27)+"[2J"+Chr$(27)+"[3;6H"; ' Escape codes to clear screen & move cursor to Row 3; Column 6 Print Str$(x); ' Print value of counter at cursor location (set above) x=x+1 ' inc counter Pause 333 ' delay a bit Loop ' and repeat . . . Try the above and see if it works for you too !! Regards, Phil For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
Geoffg Guru Joined: 06/06/2011 Location: AustraliaPosts: 3196 |
There is a little shortcut that you can use here, the elements of a PRINT statement will be joined together when printed if they are separated by just spaces or nothing. So, you don't need the semicolon (;) or the plus (+) characters. For example, using Phil's example above, this will also work: Print Chr$(27) "[2J" Chr$(27) "[3;6H"; ' Escape codes to clear screen & move cursor to Row 3; Column 6
Geoff Geoff Graham - http://geoffg.net |
||||
WhiteWizzard Guru Joined: 05/04/2013 Location: United KingdomPosts: 2817 |
Thats worth knowing for the future You're not wrong Geoff when you say its ' a LITTLE shortcut' ! For everything Micromite visit micromite.org Direct Email: whitewizzard@micromite.o |
||||
Frank N. Furter Guru Joined: 28/05/2012 Location: GermanyPosts: 831 |
Thanks to White Wizzard, Psergiu and Geoff!!! @ White Wizzard: I evaluate my ISL29023 lightsensor with my adapted program for µMite which I offered in this thread: http://www.thebackshed.com/forum/forum_posts.asp?TID=6161&PN =1 You are right that a LCD is necessary for a finished gadget but for my tests I have only the sensor, 1 LED and a PL2303 on my µMite. Thanks a lot to all for helping! I tried it with >> Chr$(27)+"[2JChr$(27)+"[H << but I have forgotten the semicolon on the end!!! ...but with this little change my code print the values correct in the first line!!! Print Chr$(27) "[2J" Chr$(27) "[H"; works very fine!!! Frank |
||||
Print this page |