i want convert hex to decimal

i am receiving number from ADC naturally its in the form of hex,but i need display it as decimal
so its need conversion or any other method
pls help me

Parents
  • You don't mention what chip you have but there is normally not anything "hex" about the value you get from an ADC - it's normally a number of bit positions in a register that stores a value.

    When presenting a value, it's possible to decide on binary, octal, decimal, hexadecimal or any other suitable numeric base to use.

    What issues do you see with displaying the value you get from the ADC compared to printing the numeric value 1 or the numeric value 193? Do you think a function like sprintf() care about where you got the number?

Reply
  • You don't mention what chip you have but there is normally not anything "hex" about the value you get from an ADC - it's normally a number of bit positions in a register that stores a value.

    When presenting a value, it's possible to decide on binary, octal, decimal, hexadecimal or any other suitable numeric base to use.

    What issues do you see with displaying the value you get from the ADC compared to printing the numeric value 1 or the numeric value 193? Do you think a function like sprintf() care about where you got the number?

Children
More questions in this forum