View Single Post
  #11   Spotlight this post!  
Unread 09-12-2004, 18:54
stephenthe1 stephenthe1 is offline
Registered User
#1008
 
Join Date: Dec 2004
Location: Ohio
Posts: 113
stephenthe1 is on a distinguished road
Re: how about this code.

Quote:
Originally Posted by Mark McLeod
Could work.

You still need to initialize "static unsigned int encoder= 0;" as Mike mentioned.

I still think you're going to count each encoder tick more than once and your arm will end up short of the expected position.

( I have to pickup my daughter and will check back later)
if I initialize it as zero, won't the program simply reset encoder to zero every time it rereads the code?