C and C++

Moderators: None (Apply to moderate this forum)
Number of threads: 28695
Number of posts: 94715

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
CGROM table Posted by samuelmoneill on 23 Apr 2009 at 1:10 AM
Hi,

I am writing a program in C that takes user input from a WinXP machine and sends it through a Serial Com Port to an LCD Screen.

The LCD screen has an in-built CGROM table for example the "tab" command \137 represents superscript 9 on LCD screen.

My program takes 1 character at a time from user input on stdin and adds it to a char string.

Does anyone know how I can send the \137 to the screen to get a superscript 9? at the moment it takes it at face value, converts the "\" to ö to give ö137?

my user input code is
         printf("Enter line %d(<=20 chars): ", line);
         c = getchar();
         char_count = 0;
         while((c != '\n') && (char_count < MAXBUFFERSIZE)) {
              buffer[char_count++] = c;
              c = getchar();
              }
         buffer[char_count] = 0x00;

Any help would be greatly appreciated.



 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.