View Single Post
  Spotlight this post!  
Unread 12-02-2005, 21:15
Don Reid Don Reid is offline
Registered User
#0997
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Corvallis, Oregon
Posts: 45
Don Reid will become famous soon enough
Re: Calling Incorrect Interrupt Handler

This sounds strangely like a problem I just had. It turned out that nothing was wrong with the encoder code (of course), just a printf statement.

Note that Get_Right_Encoder_count() returns a long! So you cannot
just put it into a printf with a %d type. If you have 2 %ds, you will
get 1/2 of the long for each one, the upper part is usually 0.

The thing to do is to use %ld to let printf know to expect a long value.
__________________
Don Reid