[En-Nut-Discussion] Problem with VT52 (dev/term.c)

José Vallet jose.vallet at hut.fi
Tue Apr 15 14:33:08 CEST 2008


We have been using it without problems either.

Here goes a piece of code that does something similar. We use the 
defines provided in term.h to avoid little errors as the one Michael 
noticed.

-------------------------
//Place the cursor in the HOME position
fprintf(lcd_uart, ESC_CLRHOME);
//Print the info in certain fixed position usint VT52 controls
fprintf(lcd_uart, "Vo=%i" ESC_POS 
"%c%cIo=%i\n",stack_volt,32+0,32+8,current);
fprintf(lcd_uart, "Air=%i\n",air_flow);
fprintf(lcd_uart, "To=%i" ESC_POS "%c%cT1=%i",stack_temp,32+3,32+8,temp_d);
---------------------------

Regards
José

Michael Jones wrote:
> There is at least one small error in the code below:
> 
> \x27 should be \x1b (hex) or \033 (octal) for ESC
> 
> This should help...
> 
> Cu,
> Michael
> 
> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de
> [mailto:en-nut-discussion-bounces at egnite.de] On Behalf Of Thiago A. Corrêa
> Sent: Tuesday, April 15, 2008 1:19 AM
> To: Ethernut
> Subject: [En-Nut-Discussion] Problem with VT52 (dev/term.c)
> 
> Hi,
> 
>    Is there anyone using the VT52 commands implemented in term.c? ie:
> 
> 	if ((lcd = fopen("lcd", "w")) == 0)
> 	{
> 		ERROR("Error trying to open LCD device");
> 		NutThreadExit();
> 	}
> 
> 	fprintf( lcd, "\x27" "E" );
> 	fprintf( lcd, "\x27Y%c%c", 32, 32 );
> 	fprintf( lcd, "abcdefh - abcd" );
> 	fprintf( lcd, "\x27Y%c%c", 32 + 1, 32 + 5);
> 	fprintf( lcd, "lalala");
> 
>     This doesn't seam to give the right output. I thought it might
> have been the LcdCursor() from arch/avr/dev/lcd.c so I simplified it
> porting back the arm code (which is cleaner), but still had the same
> results.
>     It would be nice to hear from other users success or failure stories.
> 
> Kind Regards,
>     Thiago A. Correa
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 




More information about the En-Nut-Discussion mailing list