CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

gethex()

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

gethex()
PostPosted: Sun Feb 05, 2012 12:22 pm     Reply with quote

Hi I'm a new in a CCS programming. I met the function gethex() in one code, but I can't figure out what is that mean. The code is from the Examples folder of CCS program directory.
Here is the code:
Code:

void main() {

   unsigned int8 i, j, address;
   INTEE value;

   do {
      printf("\r\n\nEEPROM:\r\n");              // Display contents of the first 64
      for(i=0; i<=3; ++i) {                     // bytes of the data EEPROM in hex
         for(j=0; j<=15; ++j) {
            printf( "%2x ", read_eeprom( i*16+j ) );
         }
         printf("\n\r");
      }
      printf("\r\nLocation to change: ");
      address = gethex();
      printf("\r\nNew value: ");
      value = gethex();   // Rikotech8: My attention point!

      write_eeprom( address, value );

   } while (TRUE);
}

Excuse my poor english!
thx in advance.
temtronic



Joined: 01 Jul 2010
Posts: 9181
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sun Feb 05, 2012 1:36 pm     Reply with quote

gethex() allows you to enter a byte of data in hex format instead of decimal (00 to FF instead of 0 to 255).
Very handy for loading in long data streams, especially from an 'outside ' source (like a file on a PC). Quicker if inputting by a keypad, 1 less keypress (2 instead of 2).
rikotech8



Joined: 10 Dec 2011
Posts: 376
Location: Sofiq,Bulgariq

View user's profile Send private message

PostPosted: Tue Feb 07, 2012 11:36 am     Reply with quote

Ahem I see. OK Thx@
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group