View Single Post
  #3   Spotlight this post!  
Unread 18-06-2008, 09:34
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,567
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Displaying a 16 bit integer on PIC 16F877?

More important then knowing the type of PIC is what compiler you are using.

In C18 %ld prints in hex and expects a long (32 bits) while an int is 16 bits
In a compiler for your computer, both an int and a long are 32 bits, and both %d and %ld would print the same thing with both.

Other compilers (especially embedded compilers) will all have small variations like that, that you can only learn about by reading the manual.