📄 +++
字号:
C51 COMPILER V8.02 MAIN 08/04/2010 15:09:42 PAGE 1
C51 COMPILER V8.02, COMPILATION OF MODULE MAIN
OBJECT MODULE PLACED IN main.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE main.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include"STC89C51RC.H"
2 #include<absacc.h>
3 #include"ds18b20.h"
4 #include"lcd1602.h"
5 #include"ds1302.h"
6 #include"2402.h"
7 uchar data datadis[]={0x00,0x00,0x00,0x00,0x00};
8 uint temp=0;
9 sbit K1=P3^5;
10 sbit K2=P3^4;
11 sbit K3=P3^3;
12 sbit K4=P3^2;
13 sbit K5=P3^0;
14 sbit L1=P1^6;
15 sbit speaker=P1^0;
16 uchar keynum=1,flag,flag1,flag2,adder,q;
17 uint k,count,th,tl;
18 uchar th1=8;
19 uchar th2=5;
20 uchar th3=2;
21 uchar th4=0;
22 uchar tab,w;
23 void delay(uchar z)
24 {
25 1 uchar x,y;
26 1 for(x=z;x>0;x--)
27 1 for(y=110;y>0;y--);
28 1 }
29 uchar key4()
30 {
31 1 if(K4==0)
32 1 {
33 2 delay(5);
34 2 if(K4==0)
35 2 {
36 3 while(!K4);
37 3 keynum++;
38 3 if(keynum==5)keynum=1;
39 3 }
40 2 }
41 1 return keynum;
42 1 }
43 void key_lcd()
44 {
45 1 if(flag1==1&&k==3) //k一定不能掉,不然会在其他菜单里出现乱码
46 1 {
47 2 if(K3==0) //按键判断,选择设置温度的光标
48 2 {
49 3 delay(5);
50 3 if(K3==0)
51 3 {
52 4 while(!K3);
53 4 flag++; //按键标识位
54 4 if(flag==5)flag=1;
55 4 }
C51 COMPILER V8.02 MAIN 08/04/2010 15:09:42 PAGE 2
56 3 }
57 2 switch(flag)
58 2 {
59 3 case 1:
60 3 {
61 4 if(K1==0)
62 4 {
63 5 delay(5);
64 5 if(K1==0)
65 5 {
66 6 th1++;
67 6 while(!K1);
68 6 if(th1==10)th1=0;
69 6 }
70 5 }
71 4 if(K2==0)
72 4 {
73 5 delay(5);
74 5 if(K2==0)
75 5 {
76 6 th1--;
77 6 while(!K2);
78 6 if(th1==-1)th1=9;
79 6 }
80 5 }
81 4 write_cmd(0xc3);
82 4 write_dat(th1+0x30);
83 4 }break;
84 3 case 2:
85 3 {
86 4 if(K1==0)
87 4 {
88 5 delay(5);
89 5 if(K1==0)
90 5 {
91 6 th2++;
92 6 while(!K1);
93 6 if(th2==10)th2=0;
94 6 }
95 5 }
96 4 if(K2==0)
97 4 {
98 5 delay(5);
99 5 if(K2==0)
100 5 {
101 6 th2--;
102 6 while(!K2);
103 6 if(th2==-1)th2=9;
104 6 }
105 5 }
106 4 write_cmd(0xc4);
107 4 write_dat(th2+0x30);
108 4 }break;
109 3 case 3:
110 3 {
111 4 if(K1==0)
112 4 {
113 5 delay(5);
114 5 if(K1==0)
115 5 {
116 6 th3++;
117 6 while(!K1);
C51 COMPILER V8.02 MAIN 08/04/2010 15:09:42 PAGE 3
118 6 if(th3==10)th3=0;
119 6 }
120 5 }
121 4 if(K2==0)
122 4 {
123 5 delay(5);
124 5 if(K2==0)
125 5 {
126 6 th3--;
127 6 while(!K2);
128 6 if(th3==-1)th3=9;
129 6 }
130 5 }
131 4 write_cmd(0xcb);
132 4 write_dat(th3+0x30);
133 4 }break;
134 3 case 4:
135 3 {
136 4 if(K1==0)
137 4 {
138 5 delay(5);
139 5 if(K1==0)
140 5 {
141 6 th4++;
142 6 while(!K1);
143 6 if(th4==10)th4=0;
144 6 }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -