View Single Post
  #19   Spotlight this post!  
Unread 31-01-2006, 13:27
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
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.
Indeed, our team learned that lesson the hard way....