View Single Post
  #1   Spotlight this post!  
Unread 17-06-2008, 22:47
Ian Curtis Ian Curtis is offline
Best Available Data
FRC #1778 (Chill Out!)
Team Role: Engineer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Puget Sound
Posts: 2,520
Ian Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond reputeIan Curtis has a reputation beyond repute
Displaying a 16 bit integer on PIC 16F877?

So, I've been playing around with a 16F877, and I got my hands on one of the kit gyros, and am trying to write my own code for it. I've got it mostly working, but I need to display a 16 bit integer to figure out what constitutes a 90 degree turn. But, the PIC doesn't want to do it. I can't for the life of me get it to output a 16 bit integer (that I can understand) to the debugger using a printf. I've tried %ld, but it didn't give me the right number. Is there some other trick (or formatting) I can use?
__________________
CHILL OUT! | Aero Stability & Control Engineer
Adam Savage's Obsessions (TED Talk) (Part 2)
It is much easier to call someone else a genius than admit to yourself that you are lazy. - Dave Gingery