![Advanced Member level 7](/styles/images/ranks/hlevel4.gif)
- Joined
- Jan 22, 2008
- Messages
- 52,830
- Helped
- 14,775
- Reputation
- 29,835
- Reaction score
- 14,207
- Trophy points
- 1,393
- Location
- Bochum, Germany
- Activity points
- 299,912
I guess, you expect highbyte to be copied to the upper byte of full_value?
But according to C language rules it isn't. high_byte<<8 is still an int8 value. (int16)high_byte<<8 will do.
With CCS C, you'll possibly want to use the built-in make16() function for this purpose, or even more comfortable, use the respective ADC functions.
Code:
full_value = ((high_byte<<8)|low_byte);
With CCS C, you'll possibly want to use the built-in make16() function for this purpose, or even more comfortable, use the respective ADC functions.