micko
January 15, 2011, 11:57am
1
Hey everyone,
I am trying to create a function in Arduino that moves the cursor in a terminal client. I have a function definition of:
void MoveCursor(uint8_t x, uint8_t y).
Can someone show me how to do something like this using Serial.Print() functions?
Regards
Michael
liudr
January 16, 2011, 2:31am
2
One needs more details than what you provided to help you. What’s a terminal client? A PC? Are you trying to send a key press to it using Arduino?
micko
January 16, 2011, 3:06pm
3
Ok, for terminal clients, there are escape sequences that can manipulate the terminal in different ways(clear the terminal, clear the line, change the colour of the screen/font)
See: http://en.wikipedia.org/wiki/ANSI_escape_code
So for example, this is how I would clear the current line in a terminal using arduino:
Serial.print(27,BYTE);
Serial.print(“[K”);
I want to be able do the ‘Cursor Position’ command from that escape code list. Can someone please help me
Michael
liudr
January 16, 2011, 5:33pm
4
That wiki page is hard for me. don’t now why, maybe no experience with old terminals at all explains.
Will this work?
Serial.print(27,BYTE);
Serial.print(“A”);
Or maybe:
Serial.print(27,BYTE);
Serial.print(1,BYTE);
Serial.print(“A”);
micko
January 17, 2011, 2:19pm
5
Don’t worry, I found it here:
http://www.arduino.cc/cgi-bin/yabb2/YaB … 1266006508
Thanks for your help!