Re: RobotC 8.23 firmware fails with unsigned values
The compiler is calculating this correctly. a "byte" is the same as a "char" which has a range of -128 to +127. When you assign a value of 255, it will overflow and end up with a value of -1.
Here is proof from a GCC compiler which exhibits the same behavior. http://i.imgur.com/BQQ7yQZ.png
Try using a ubyte instead which has a range of 0-255 and will be able to store your value.
ROBOTC Developer - SW Engineertfriez@robotc.net