View Single Post
  #8   Spotlight this post!  
Unread 14-02-2005, 18:06
ScottWolchok ScottWolchok is offline
Pwnt.
#0217 (ThunderChickens)
Team Role: Programmer
 
Join Date: Oct 2003
Rookie Year: 2004
Location: Utica, MI
Posts: 23
ScottWolchok will become famous soon enoughScottWolchok will become famous soon enough
Send a message via AIM to ScottWolchok
Re: Calling Incorrect Interrupt Handler

Quote:
Originally Posted by Don Reid
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.
Yeah, that's exactly it. I casted the return values to int, and they still seem to be backwards, but I just swapped the wiring and carried on.