Quote:
|
Originally Posted by Mark McLeod
Yes, you'd get 0xBBBB.
Always use a type that will hold your largest possible final value.
In this case you could shift right 16 bits.
The PIC evaluates an expression based on the largest type variable used in the expression. You can add an explicit type, e.g., (long), to force the PIC to use a long for all calculations.
|
Thanks! your suggestion worked. Now the robot's printing out the right values. Now to get the motors to turn...