View Single Post
  #20   Spotlight this post!  
Unread 31-01-2006, 15:34
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,080
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: Manual Velocity PID, anyone successful?

Quote:
Originally Posted by Joel J.
if control can be negative, then a right shift can have a disastrous effect! mcc18 v2.4 does NOT shift in 1's for a negative number. Instead, it treats all numbers as unsigned.

For example,

int control = -16;
control = control >> 2;

After that snippet, you'd expect control to be -4, but in actuality its 16380. Quite different.
Wow - I definately would have thought that a shift would extend the sign.

I guess I should have RTFM.