Embedded C: defining a BYTE?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • spoken
    New Member
    • Oct 2007
    • 15

    Embedded C: defining a BYTE?

    Hi,

    I'm having problem defining a BYTE in this embedded C application that I writing.

    I know that the byte representation for carriage return is : A0

    What I'm doing is:
    Code:
    BYTE enterKey = AO;
    ConsolePutROMString( (ROM char *)"LISTEN TO KEYBOARD\r\n" );
        if(ConsoleIsGetReady()){
              keyboard = ConsoleGet();								
             while(!keyboard==enterKey) {
    	    keyboard = ConsoleGet();
    	    PrintChar( keyboard );
               ConsolePutROMString( (ROM char *)" - KEYBOARD MESSAGE\r\n" );
    }
    }
    Basically i'm trying to read the console and if there is a keyboard input, I'll do a while loop to keep reading the input until I receive an "enter" key.

    Thanks.
  • Banfa
    Recognized Expert Expert
    • Feb 2006
    • 9067

    #2
    Originally posted by spoken
    I know that the byte representation for carriage return is : A0
    But it isn't, it's 0x0A

    Comment

    • spoken
      New Member
      • Oct 2007
      • 15

      #3
      Originally posted by Banfa
      But it isn't, it's 0x0A
      Yes, i finally manage to do it by defining
      BYTE e = 0x0A;

      Thanks

      Comment

      Working...