pnielsen
Member level 2
- Joined
- Mar 18, 2002
- Messages
- 50
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,286
- Activity points
- 319
I am trying to convert hexidecimal to decimal in C code. If I uncommit the // the program will display ox141E into decimal. But I am stuped at the syntax to convert the hexadacimal to decimal. Any help would be tremendous.
Thank You
Philip
Thank You
Philip
Code:
void Display_Result(void)
{
// value 0x141E;
LCD_Char_Position(0,6);
LCD_Char_PrintInt8(HYT221_Read_Buff[0] & 0x3f); //Mask HYT humidity the highest two status bits
LCD_Char_PrintInt8(HYT221_Read_Buff[1]);
LCD_Char_PrintString(" ");
LCD_Char_Position(1,6);
sprintf(HYT221_Read_Buff, "0x%X", decimal_value);
// temp =(buffer, "%d", HYT221_Read_Buff[1]);
// temp =(buffer, "%d", value);
// temp = (temp *100/16383);
// LCD_Char_Position(1,6);
// LCD_Char_PrintNumber(temp);
}
/* [] END OF FILE */
Last edited by a moderator: