Hello All I am working with a energy metering project . I am using HyperTerminal privet edition v6.3 as my output terminal to show the voltages current and all the parameters . Keil c compiler and cygnal 8051f120 evaluation board are used for the development . when I tried to update the whole content and update it with my new reading it takes a lot of time . I creates a burden for my program .so I tried ANSI Escape Sequence. I am facing some problem in this phase . some of these sequences are working fine while some are not. I tried with ansi and vt100 emulations I got clear_screen(); and cursor_home(); functions working but I am unable to make out any cursor positioning functions so I am posting these functions with this letter expecting your kind help void clear_screen (void) { putchar(0x1B); putchar('['); putchar('2'); putchar('J'); }//working void cursor_home (void) { printf("%c[H",ESC,ESC); }//working void cursor_point (unsigned char row,unsigned char col) { putchar(ESC); putchar('['); putchar(row); putchar(';'); putchar(col); putchar('H'); }//->the output is ; H; H
It was Dan that spotted the problem!
Thanks u all My problem was because i was not sending the ASCII charcters to pint the cursor.now its working fine.thanks ones again Mr Neil for ur time and help Venkatesh
"IIRC, the coordinates must be decimal numbers, not binary" Yes - See the examples on this page: http://www.delmar.edu/Courses/CIS415L/ANSIsys.htm
ESC[13;40f - move cursor to centre of screen
void cursor_point( unsigned char row, unsigned char col ) { printf( "\x1B[%bu;%buH", row, col ); }
"What is ESC in your program? ... Maybe you have to replace this with the HEX equivilant to the ascii escape character." Yes - either
#define ESC 0x1B
#define ESC 27
What is ESC in your program? Does this equate to a special character? It doesn't look it here. Maybe you have to replace this with the HEX equivilant to the ascii escape character. Andy
IIRC, the coordinates must be decimal numbers, not binary.
Have you tried this on other terminal emulators?
View all questions in Keil forum