Thread: Encoder help
View Single Post
  #9   Spotlight this post!  
Unread 03-12-2005, 21:54
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Encoder help

Quote:
Originally Posted by RbtGal1351
I had a problem much like that before; none of my variables (longs) would change ever. Then I changed them to ints and it worked.
I suspect they were changing as they should, and the problem was that they just weren't printing correctly. printf isn't very friendly, and expects to print ints unless you can convince it otherwise. If you try to print a long the way you print most things, you just get the top couple of bytes of the value, which is usually going to end up being either 0 or -1.