Hello,
I want to do something like this:
- define asci escape code of cursor position - for example [20;20H in array (
char* position[] = {"\"[20;20H\"", "\"[25;25H\""};
- then I want to use this coordinates in Serial.write()
Serial.write(27);
Serial.write(position[0]);
- and then print ther something
Serial.print("Something");
What am I doing wrong? A result that I see on Putty terminal emulator is something like that 20:20H"
in random position. Please help me.
- then I want to use this coordinates in Serial.write()
What is Serial.write(27) supposed to be doing?
What am I doing wrong?
Posting snippets, instead of all of your code.
Not explaining what the code ACTUALLY does.
Not explaining what you are sending the serial data to.
Serial.write(27); is a ESC
Ok my code is:
void setup(){
Serial.begin(9600);}
void loop(){
char* position[]={"\"[22;20H\"" , "\"[25;25H\""};
Serial.write(27); //this means ESC
Serial.write(position[0]); //this should place cursor in right row and column
Serial.print("Something");
delay(2000);
}
A result on Putty is:
[22,20H" Something
Serial.write(postioion[0]) doesn't set a cursor in right place.
Serial.write(postioion[0]) doesn't set a cursor in right place.
Igñoring the spelling, writing a single character isn't going to move the cursor - you need to send the whole string.
Igñoring the spelling, writing a single character isn't going to move the cursor - you need to send the whole string.
position[ 0 ] is a pointer. The function call is correct.