PuTTY -Terminal an MCU: Bildschirm löschen Sequenz ?

OP #7537648
Lesenswert?

Hallo, ich habe eine MCU über USB an den PC mit PuTTY Terminal angeschlossen.

Dieser Code läuft:

1
if (com1ReadBuffer[0] == 49) strcpy((char *)com1WriteBuffer,"Eins");
2
if (com1ReadBuffer[0] == 50) strcpy((char *)com1WriteBuffer,"Zwei");

Wenn ich am Keyboard "1" drücke, wird der Text "Eins" geschrieben. Bei "2" entsprechend "Zwei".

Ich möchte jetzt, dass der Bildschirm vor der Ausgabe eines neuen Wortes immer gelöscht wird. Welches Steuerzeichen muss man da senden ?

#7537710
Lesenswert?

Norbert schrieb:

<ESC>[1;1f

interessant, warum nicht <ESC>[1;1H, kann jemand den Unterschied erklären? ECMA-48 schreibt

1
CUP  CSI Pn1;Pn2 04/08   <ESC>[1;1H
2
CUP causes the active presentation position to be moved in the
3
presentation component to the n-th line position according to
4
the line progression and to the m-th character position according
5
to the character path
1
HVP   CSI Pn1;Pn2 06/06   <ESC>[1;1f
2
HVP causes the active data position to be moved in the data
3
component to the n-th line position according to the line
4
progression and to the m-th character position according to
5
the character progression
#7537718
Lesenswert?

Bauform B. schrieb:

kann jemand den Unterschied erklären?

https://ecma-international.org/wp-content/uploads/ECMA-48_5th_edition_june_1991.pdf

Setzt sich wie folgt zusammen:

(Kurzbeschreibung aus Glossar)

Active data position The character position in the data component which is to receive the next graphic character or the next control function from the data stream and relative to which certain control functions are to be executed.

Active presentation position The character position in the presentation component which is to receive the next graphic character for graphic image output and relative to which certain control functions are to be executed. NOTE In general, the active presentation position is indicated in a display by a cursor.

Data component The device component which is used for storing the received data for further presentation processing.

Presentation component The device component which is used for producing the graphic image output.

Im Detail:

6.1.1 Presentation component (S. 14 28/108)

6.1.3 Data component (S. 15 29/108)

und vor allem

6.1.5 Relationship between active data position and active presentation position (S. 15 29/108)

Fazit: Wohl meistens dasselbe.

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren