当前位置:首页 > 电子体温计设计1.1 - 图文
电子体温计设计
a9=(unsigned int) (time_buf2[4]/16); a10=(unsigned int)(time_buf2[4]);//串口接收第5个16进制温度字节,并且把个位和十位分离,只取有效数据个位。 a11=(unsigned int)(time_buf2[5]/16); a12=(unsigned int)(time_buf2[5]);//串口接收第6个16进制温度字节,并且把个位和十位分离,只取有效数据个位。 a13=(unsigned int)(time_buf2[6]/16); a14=(unsigned int)(time_buf2[6]);//串口接收第7个16进制温度字节,并且把个位和十位分离,只取有效数据个位。 a15=(unsigned int)(time_buf2[7]/16); a16=(unsigned int)(time_buf2[7]);//串口接收第8个16进制温度字节,并且把个位和十位分离,只取有效数据个位。 Temperature=a2*1000+a4*100+a6*10+a8+0; //将分离开的温度数据组合成一个数据,OffSetValue是校准值 Temperature2=a10*1000+a12*100+a14*10+a16+0; //将分离开的温度数据组合成一个数据,OffSetValue是校准值 a=Temperature/1000; b=(Temperature00)/100; c=(Temperature0)/10; d= Temperature;
LCDDispString(0,1,\ if(a==9) { LCDDispString(7,1,\ } else { LCDDispNum(7,1,a); //液晶显示温度的百位 } LCDDispNum(8,1,b); //液晶显示温度的十位 LCDDispNum(9,1,c); //液晶显示温度的个位
-40-
电子体温计设计
LCDDispString(10,1,\ //液晶显示字符“.” LCDDispNum(11,1,d); //液晶显示温度小数点最后一位 LCDDispChar(12,1,0xdf); //液晶显示温度符合 示字符\ 一位 } } }
LCDDispString(13,1,\ //液晶显 e=Temperature2/1000; f=(Temperature200)/100; g=(Temperature20)/10; h= Temperature2; LCDDispString(0,2,\ if(e==9) { LCDDispString(7,2,\ } else { LCDDispNum(7,2,e); //液晶显示温度的百位 } LCDDispNum(8,2,f); //液晶显示温度的十位 LCDDispNum(9,2,g); //液晶显示温度的个位 LCDDispString(10,2,\ //液晶显示字符“.” LCDDispNum(11,2,h); //液晶显示温度小数点最后 LCDDispChar(12,2,0xdf); //液晶显示温度符合 LCDDispString(13,2,\ //液晶显示字符\ -41-
电子体温计设计
************************************************************************************************************************** $NOMOD51
;------------------------------------------------------------------------------ ; This file is part of the C51 Compiler package
; Copyright (c) 1988-2005 Keil Elektronik GmbH and Keil Software, Inc. ; Version 8.01 ;
; *** <<< Use Configuration Wizard in Context Menu >>> *** ;------------------------------------------------------------------------------ ; STARTUP.A51: This code is executed after processor reset. ;
; To translate this file use A51 with the following invocation: ;
; A51 STARTUP.A51
-42-
电子体温计设计
;
; To link the modified STARTUP.OBJ file to your application use the following ; Lx51 invocation: ;
; Lx51 your object file list, STARTUP.OBJ controls ;
;------------------------------------------------------------------------------ ;
; User-defined
; With the following EQU statements the initialization of memory ; at processor reset can be defined: ;
;
; Note: The absolute start-address of IDATA memory is always 0
; The IDATA space overlaps physically the DATA and BIT areas. IDATALEN EQU 80H ;
;
;
;
;
;------------------------------------------------------------------------------ ;
-43-
共分享92篇相关文档