FullDuplexSerial control codes
frank freedman
Posts: 1,983
in Propeller 1
Is there a clear screen code in full duplex serial object?
Thx
Thx
Comments
In the PST (parallax serial terminal, 0 or 16 does the job)
You can find this in the Preferences of the PST.
In the Putty terminal you can use ansi control codes.
I prefer to use putty as my terminal because you can do colors and other fancy things.
Escape codes: https://forums.parallax.com/discussion/comment/1434641/#Comment_1434641
You can even do full "graphics" with ansi and putty. (ansi art)
https://forums.parallax.com/discussion/comment/1434744/#Comment_1434744
....
Thank you all for the fast replies.
@JonnyMac, your con listing helped solve it. I had tried using $10 and that did not really clear it (possibly the PUTTY setting?), but using $C, the form feed took care of the issue.
@"Clock Loop", Guess I make some less than optimal assumptions on the PUTTY setup. Had not looked for a PUTTY setup screen such as you have posted. Gonna revisit that one now. Thx
Close but I need to dig more on escape sequences.
Parallax forums, best peeps, best ideas and help when needed!!
P.S. I've always wondered why PST pays no regard to these terminal standards and seems to be setup to emulate serial LCD codes for compatibility. What is needed in PST is an "LCD emulation mode" button just for that.
I know the parallax serial terminal ascii codes do not work the same in putty, I don't use them.
I strictly stick to ansi escape codes with putty, putty doesn't have a setup screen like the pst does(thats the image i posted from parallax serial terminal)
The way they work is you first must SET COMMAND MODE before every command.
And you must do it again if you issue another ansi command.
And again if you issue yet another command.
The sequence is, set command mode, then set the command, then send the text.
https://forums.parallax.com/discussion/comment/1453119/#Comment_1453119
Here are some escape sequences:
For putty and ansi escape codes, heres how I do it in an accelerometer debug output to the putty terminal.
https://forums.parallax.com/discussion/comment/1507383/#Comment_1507383
I removed all the code except the ansi command codes and sequences.
https://hackaday.io/project/162734-a-trillion-year-clock
Nice, this will do very nicely for what I am trying to do. Thank you. If I get it right, I can place the labels on the screen where I want and then paste the values as needed whenever on an ANSI compliant terminal?
becomes
-Phil
Thats exactly it, with ansi, you tell it what position you want your text.
There are other command codes, but I do not know exactly which ones will work in putty.
https://en.wikipedia.org/wiki/ANSI_escape_code#Escape_sequences
All the ones in my example code above do work, i know that (so the text attributes and colors, cursor positioning etc)
For some, needing to set the exact position of all text is annoying, but personally I love it, even though it gets kinda repetitive.
Clear the screen at the first part of the loop.
You don't HAVE to do this, but it prevents serial data output corruption that sometimes happens.
Overwriting specific positions is possible but I found that when you don't repaint it all, things start to deteriorate.
Set any special text features, like color or bold, etc.
Set your position, this one is 3 lines down, 5 spaces in. Set the cursor position right before you output your text
or you will have annoying blinking cursors all over the place in your terminal.
Output the text and values
Always set the cursor position back to 1,1 before you do any thing else in your code,
or you will have annoying blinking cursors all over the place in your terminal.
FYI, I THINK TEXT ATTRIBUTES STAY ON, until you turn them off or change the attributes.
There is a command to turn off all attributes...
Oh right, I suppose that does reduce code space and timing...
My brain forgets things faster than a cat does, so I end up writing everything out, slow, clunky, and like a moron.
That way I can read it 2 years from now and not scratch my head wondering wtf, and how did I even figure that out...