Цитата(toweroff @ Dec 20 2011, 15:17)

...и содержимое 7 младших битов есть дополнение до 0
Дошло. В случае отрицательной температуры надо добавить:
temp = 256 - temp;Код
unsigned char temp = 0x19;
char convert[16];
...
temp = temp - 0x28;
if (temp & 0x80) {
temp = 256 - temp;
sprintf(convert,"-%d",temp);
put_string(115,4,convert,color_chislo,1);
}
else {
sprintf(convert,"%d",temp);
put_string(115,4,convert,color_chislo,1);
}
Выводит -15. Ура! Спасибо!
Сообщение отредактировал mr_smit - Dec 20 2011, 20:02