Thread: Encoder Code
View Single Post
  #8   Spotlight this post!  
Unread 14-02-2009, 22:58
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,078
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Encoder Code

This is because the Encoder::Get() method returns an INT32 (an int), while the %E printf() token indicates a double.

Try:

printf("Encoder Motor 1: %d\n", encoderMotor1->Get());
printf("Encoder Motor 2: %d\n", encoderMotor2->Get());
Reply With Quote