Ashni85
Newbie level 5
I have a quick question regarding the conversion of an ADC result on an AVR chip (mega644) to 16 bit. Since the result is 10 bits from an ADC conversion, how would I convert to 16 bits?
I have my result, say stored in h as
h = (ADCH<<6)|(ADCL<<2)
and h is defined as:
uint_16t h;
and i want to display my h through a uart in hex as:
printf("03X", h);
Would this conversion to 16bit work?
I have my result, say stored in h as
h = (ADCH<<6)|(ADCL<<2)
and h is defined as:
uint_16t h;
and i want to display my h through a uart in hex as:
printf("03X", h);
Would this conversion to 16bit work?