I am programming into a TMS320F28335 controlcard. I want to convert variable in into varialbe in2. in is declared as Uint and in2 is declared as int. Uint holds a 12 bit adc conversion number between 0x0FFF (3.3V adc (4095)) and 0x0000 (0V adc (0)). I want to convert in into in2 so that in2 holds a 12 bit signed number between 2047 and -2048 without overflow.
↧