接口技术课程设计报告-基于单片机的空调温度控制器设计内容摘要:
splay_Temperature()。 T_Count=0。 if(++P_Count == 6) { N_Count=1。 } TR0=1。 } } ////////////////////主程序 /////////////////////////////// void main() { init_lcd()。 Init_DS18B20()。 timer0_init()。 while(1) { Print()。 set_num()。 Comparison()。 } } 18 void Comparison() { if(N_Countamp。 amp。 M_Count) { if(TEMP_NOWTEMP_SET) { warm=1。 cold=0。 } if(TEMP_NOWTEMP_SET) { cold=1。 warm=0。 } if(TEMP_NOW==TEMP_SET) { cold=0。 warm=0。 } } } : ifndef _18B20_H define _18B20_H include extern uchar Init_DS18B20()。 extern void Read_Temperature()。 extern void Display_Temperature()。 endif : include include 19 define delayNOP() {_nop_()。 _nop_()。 _nop_()。 _nop_()。 } uchar code Temperature_Char[8] = {0x0c,0x12,0x12,0x0c,0x00,0x00,0x00,0x00}。 uchar code df_Table[]={0,1,1,2,3,3,4,4,5,6,6,7,8,8,9,9}。 uchar CurrentT = 0。 uchar Temp_Value[]={0x00,0x00}。 uchar Display_Digit[]={0,0,0,0}。 bit DS18B20_IS_OK = 1。 void Delay_INI(uint x) { while(x)。 } void Delay(unsigned int n) { do { _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 _nop_()。 n。 }while(n)。 } uchar Init_DS18B20() { uchar status。 DQ = 1。 Delay_INI(8)。 DQ = 0。 Delay_INI(90)。 20 DQ = 1。 Delay_INI(8)。 status=DQ。 Delay_INI(100)。 DQ = 1。 return status。 } uchar ReadOneByte() { uchar i,dat=0。 DQ = 1。 _nop_()。 for(i=0。 i8。 i++) { DQ = 0。 dat = 1。 DQ = 1。 _nop_()。 _nop_()。 if(DQ) dat |= 0X80。 Delay(30)。 DQ = 1。 } return dat。 } void WriteOneByte(uchar dat) { uchar i。 for(i=0。 i8。 i++) { DQ = 0。 DQ = datamp。 0x01。 21 Delay(5)。 DQ = 1。 dat = 1。 } } void Read_Temperature() { if(Init_DS18B20()==1) DS18B20_IS_OK=0。 else { WriteOneByte(0xcc)。 WriteOneByte(0x44)。 Init_DS18B20()。 WriteOneByte(0xcc)。 WriteOneByte(0xbe)。 Temp_Value[0] = ReadOneByte()。 Temp_Value[1] = ReadOneByte()。 DS18B20_IS_OK=1。 } } void Display_Temperature() { uchar t = 150, ng = 0。 if((Temp_Value[1]amp。 0xf8)==0xf8) { Temp_Value[1] = ~Temp_Value[1]。 Temp_Value[0] = ~Temp_Value[0]+1。 if(Temp_Value[0]==0x00) Temp_Value[1]++。 ng = 1。 } Display_Digit[0] = df_Table[Temp_Value[0]amp。 0x0f]。 CurrentT = ((Temp_Value[0]amp。 0xf0)4) | ((Temp_Value[1]amp。 0x07)4)。 Display_Digit[3] = CurrentT/100。 22 Display_Digit[2] = CurrentT%100/10。 Display_Digit[1] = CurrentT%10。 Current_Temp_Display_Buffer[11] = Display_Digit[0] + 39。 039。 Current_Temp_Display_Buffer[10] = 39。 .39。 Current_Temp_Display_Buffer[9] = Display_Digit[1] + 39。 039。 Current_Temp_Display_Buffer[8] = Display_Digit[2] + 39。 039。 Current_Temp_Display_Buffer[7] = Display_Digit[3] + 39。 039。 TEMP_NOW=Display_Digit[2]*10+Display_Digit[1]+Display_Digit[0]*。 if(Display_Digit[3] == 0) Current_Temp_Display_Buffer[7] = 39。 39。 if(Display_Digit[2] == 0amp。 amp。 Display_Digit[3]==0) Current_Temp_Display_Buffer[8] = 39。 39。 if(ng) { TEMP_NOW=(Display_Digit[2]*10+Display_Digit[1]+Display_Digit[0]*)。 if(Current_Temp_Display_Buffer[8] == 39。 39。 ) Current_Temp_Display_Buffer[8] = 39。 39。 else if(Current_Temp_Display_Buffer[7] == 39。 39。 ) Current_Temp_Display_Buffer[7] = 39。 39。 else Current_Temp_Display_Buffer[6] = 39。 39。 } } : ifndef _KEY_H define _KEY_H include extern unsigned char Keys_Scan()。 extern void set_num()。 extern void set()。 23 endif : include include include include uchar code KeyCodeTable[]= { 0x11,0x12,0x14,0x18,0x21,0x22,0x24,0x28,0x41,0x42,0x44,0x48,0x81,0x82,0x84,0x88 }。 void Delay_key() { uchar i。 for(i=0。 i200。 i++)。 } uchar Keys_Scan() { uchar sCode,kCode,k。 P3 = 0xf0。 if((P3amp。 0xf0)!=0xf0) { Delay_key()。 if((P3amp。 0xf0)!=0xf0) { sCode = 0xfe。 for(k=0。 k4。 k++) { P3 = sCode。 if((P3amp。 0xf0)!=0xf0) { kCode = ~P3。 if(kCode == KeyCodeTable[0]) return K_ONE。 24 else if(kCode == KeyCodeTable[1]) return K_TWO。 else if(kCode == KeyCodeTable[2]) return K_THREE。 else if(kCode == KeyCodeTable[3]) return K_FOUR。 else if(kCode == KeyCodeTable[4]) return K_FIVE。 else if(kCode == KeyCodeTable[5]) return K_SIX。 else if(kCode == KeyCodeTable[6]) return K_SEVEN。 else if(kCode == KeyCodeTable[7]) return K_EIGHT。 else if(kCode == KeyCodeTable[8]) return K_NINE。 else if(kCode == KeyCodeTable[9]) return K_UP。 else if(kCode == KeyCodeTable[10]) return K_DOWN。 else if(kCode == KeyCodeTable[11]) return K_CLEAR。 else if(kCode == KeyCodeTable[12]) return K_OK。 else if(kCode == KeyCodeTable[13]) return K_ZERO。 else if(kCode == KeyCodeTable[14]) return K_POINT。 else if(kCode == KeyCodeTable[15]) return K_SET。 } else sCode = _crol_(sCode,1)。 } } } return 1。 } void set_num() { uchar key。 if(sel==0) { key = Keys_Scan()。 if(K_CLEAR == key) { while(Keys_Scan() == K_CLEAR)。 set_Temp_Display_Buffer[8] =39。 39。 set_Temp_Display_Buffer[9] =39。 39。 set_Temp_Display_Buffer[10]=39。 39。 25 set_Temp_Display_Buffer[11]=39。 39。 // 48(0)49(1)50(2)51(3)52(4)53(5)54(6)55(7)56(8)57(9) M_Count=0。 cold=0。 warm=0。 } if(K_UP == key) { while(Keys_Scan() == K_UP)。 if((set_Temp_Display_Buffer[11]4。接口技术课程设计报告-基于单片机的空调温度控制器设计
相关推荐
钢吊钩钩住笼顶加强箍,用槽钢横担悬挂在井壁上,脱钩后借自重可保持钢筋笼标高、垂直度和保护层正确。 长 沙开福万达广场项目 C 区支护人工挖孔桩专项方案 9 中 国 建 筑 第 二 工 程 局 有 限 公 司 CHINA CONSTRUCTION SECOND ENGINEERING BUREAUS . 混凝土的灌筑 钢筋笼放置完成后,经现场监理检查验收无误后即可进行混凝土浇筑。 混凝土
的高素质人才是必不可少的。 二、教师在小学信息技术课中的作用 教师在小学信息技术课程教学中,是学生学习的组织者、引导者和促进者,在整个教学过程中起着至关重要的作用。 面对刚刚接触计算机的小学生,教师在教学中的组织、引导显得十分重要。 这就要求教师紧跟时代发展的步伐,不断学习教材、教法,更新教育教学观念, 努力提升自己的教学能力。 教师应当转变自己的角色,以学生为中心,充分从学生的角度设计教学
侧面 — — — — — 0 换挡叉头部方槽底面 — — — — — 0 换挡叉头部两侧面 10 42 G 4 螺纹孔端面 10 14 G 16 孔 — — — — — 0 换挡叉脚两 端面 10 8 2 G 换挡叉脚内表面 10 R43 G 设计毛坯图 根据表 2 所得结果,绘制毛坯简图如图 2 所示。 图 2 换挡叉毛坯简图 基面的选择 精基准的选择 根据该换挡叉零件的技术要求和装配要求
3。 50 附表 A— 6:通过详细审查的申请人排序表 51 附表 A— 7:通过资格预审的申请人 (正选 )名单 52 附表 A— 8:通过资格预审的申请人 (候补 )名单 53 第四章 资格预审申请文件格式 54 目 录 56 一、资格预审申请函 57 二、法定代表人身份证明 58 二、授权委托书 59 三、联合体协议书 60 四、申请人基本情况表 62 五、近年财务状况 表 63 六
问指导老师自己备课是否合适,听他的意见。 还经常邀请指导老师听我讲课,让他给我指出自己讲课过程中的缺点和不足,刚开始的时候老师的最多的一点就是每节课重点不突出,在经过一次次的锻炼后老师对我说现在已经能很好的把握一节课的重点难点了。 听了这些话我 明白自己有进步了一点。 三、板书不发愁 上课的过程中板书是不可或缺的,由于在实习之前我没有很好的练板书以至于刚开始时都搞不清楚 ......