怎么将温度整数调整到后面
怎么将温度整数调整到后面
int main(void)
{
short temperature;
BEEPINIT();
delay_init();
uart_init(9600);
LED_Init();
LCD_Init();
POINT_COLOR=RED;
LCD_ShowString(60,50,200,16,16,"Mini STM32");
LCD_ShowString(60,70,200,16,16,"DS18B20 TEST");
LCD_ShowString(60,90,200,16,16,"ATOM@ALIENTEK");
LCD_ShowString(60,110,200,16,16,"2014/3/12");
while(DS18B20_Init())
{
LCD_ShowString(60,130,200,16,16,"DS18B20 Error");
delay_ms(200);
LCD_Fill(60,130,239,130+16,WHITE);
delay_ms(200);
}
LCD_ShowString(60,130,200,16,16,"DS18B20 OK");
POINT_COLOR=BLUE;
LCD_ShowString(60,150,200,16,16,"Temp: . C");
TIM4_PWM_Init(899,0);//2»·ÖÆμ¡£PWMÆμÂê=72000/(899+1)=80Khz
while(1)
{temperature=DS18B20_Get_Temp();
if(temperature<0)
{
LCD_ShowChar(60+40,150,'-',16,0);
temperature=-temperature;
}else LCD_ShowChar(60+40,150,' ',16,0);
LCD_ShowNum(60+40+8,150,temperature/10,2,16);
LCD_ShowNum(60+40+32,150,temperature%10,1,16);
|