?? wendu.lst
字號:
C51 COMPILER V7.06 WENDU 06/09/2007 00:50:12 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE WENDU
OBJECT MODULE PLACED IN wendu.OBJ
COMPILER INVOKED BY: F:\單片機\工具軟件\keilc51\keil C51_V706完全破解版\文檔\C51\BIN\C51.EXE wendu.c BROWSE DEBUG OBJECT
-EXTEND
stmt level source
1 #include<reg51.h>
2 #include"lcd.h"
3 #define uint unsigned int
4 #define uchar unsigned char
5 sbit P25=P2^5; //下降沿放音
6 sbit rc=P2^6;
7 sbit a0=P2^7;
8 sbit st=P2^4;
9 sbit start=P3^2;
10 sbit up=P3^3; //加
11 sbit down=P3^4; //減
12 sbit P37=P3^7;
13 uint add;
14 bit K1;
15 bit a;
16 uchar i;
17 uchar j;
18 uint cmd,cnt;
19 uint temp1,temp2;
20 uint shuchu ;
21 uint dianya;
22 uint t ;
23 uint baoy;
24 uint cw=370;
25 bit flay;
26 uchar data led[3];
27 uchar code number[]="0123456789.";
28 uchar tab1[]="abcd 36.9d";
29 uchar tab2[]="abcd 37.0d";
30 //uchar tab1[]="當前溫度 36.9度";
31 //uchar tab1[]="aasdsd 37.0d";
32 //uchar tab2[]="aaddd: 36.9d";
33 void init(void); //中斷初始化
34 void delay(uint k);
35 void ad574(void);
36 void key(void); //鍵盤
37 void delay(uint k)//延時 k ms
38 { k=k*125;
39 1 while(k--);
40 1 }
41 void ad574(void)
42 { rc=0;
43 1 a0=0;
44 1 while(st==1);
45 1 st=1;
46 1 rc=1;
47 1 delay(10);
48 1 temp1=P1;
49 1 delay(10);
50 1 a0=1;
51 1 temp2=P1;
52 1 shuchu=(temp1<<4)+(temp2>>4);
53 1 // shuchu=2300;
54 1 if(shuchu>=0&&shuchu<2048)
C51 COMPILER V7.06 WENDU 06/09/2007 00:50:12 PAGE 2
55 1 { dianya=2048-shuchu;
56 2 flay=1 ;
57 2 }
58 1 if(shuchu>=2048&&shuchu<=4096)
59 1 { dianya=shuchu-2047 ;
60 2 flay=0;
61 2 }
62 1 //dianya=1600;
63 1 t=dianya*9/37;
64 1 t=101;
65 1 if(t>163&&t<=405)
66 1 t=t+1;
67 1 if(t>405)
68 1 t+=2;
69 1
70 1 }
71 void key(void)
72 {if(start==0&&a==0)
73 1 { delay(2);
74 2 if(start==0)
75 2 { a=1; K1=~K1;}
76 2 }
77 1 if(start==1&&a==1)
78 1 a=0;
79 1 {if(K1==1)
80 2 if(up==0&&cw<500)
81 2 { add++;
82 3 if(add==1) cw=cw+10;
83 3 if(add==250)
84 3 {cw=cw+10;add=200;}
85 3 }
86 2 else add=0;
87 2 if(down==0&&cw>0)
88 2 { add++;
89 3 if(add==1) cw=cw-10;
90 3 if(add==250)
91 3 { cw=cw-10;add=200;}
92 3
93 3 }
94 2 else add=0;
95 2 }
96 1 }
97 void init(void)
98 { TMOD=0x11;
99 1 TH0=(65536-50000)/256; //定時50MS
100 1 TL0=(65536-50000)%256;
101 1 TH1=(65536-50000)/256;
102 1 TL1=(65536-50000)%256;
103 1 TR0=1;
104 1 ET0=1;
105 1 IT0=1;
106 1 TR1=0;
107 1 ET1=1;
108 1 IT1=1;
109 1 EA=1;
110 1 }
111 void t0(void) interrupt 1 using 1
112 { TH0=(65536-50000)/256;
113 1 TL0=(65536-50000)%256;
114 1 cmd++;
115 1 if(cmd==300) // 1分鐘定時
116 1 { TR1=1;
C51 COMPILER V7.06 WENDU 06/09/2007 00:50:12 PAGE 3
117 2 cmd=0;
118 2 baoy=t;
119 2 led[0]=baoy%10;
120 2 led[1]=baoy%100/10;
121 2 led[2]=baoy/100;
122 2 P37=0;
123 2 }
124 1 }
125 void t1(void) interrupt 3 using 1
126 {
127 1 TH1=(65536-50000)/256;
128 1 TL1=(65536-50000)%256;
129 1 cnt++;
130 1 if(cnt==10) P25=1;
131 1 if(cnt==20)
132 1 { j++;
133 2 TR0=0;
134 2 cnt=0;
135 2 if(j==1)
136 2 { P0=88 ; P25=0; } //讀溫度
137 2 if(led[2]==0)
138 2 { if(j==2)
139 3 { P0=8*led[1];P25=0;}
140 3 if(led[0]==0)
141 3 { if(j==3)
142 4 { P0=104;P25=0; }
143 4 if(j==4)
144 4 {j=0;TR1=0;P0=0;P25=1;TR0=1;}
145 4 }
146 3 else
147 3 { if(j==3)
148 4 { P0=96;P25=0;}
149 4 if(j==4)
150 4 { P0=8*led[0]; P25=0;}
151 4 if(j==5)
152 4 { P0=104;P25=0;}
153 4 if(j==6)
154 4 {j=0;TR1=0;P0=0;P25=1;TR0=1;}
155 4 }
156 3 }
157 2 else
158 2 { if(j==2)
159 3 { P0=8*led[2];P25=0;}
160 3 if(j==3)
161 3 { P0=80; P25=0;}
162 3 if(led[1]==0)
163 3 { if(led[0]==0)
164 4 { if(j==4)
165 5 { P0=104;P25=0;}
166 5 if(j==5)
167 5 {j=0;TR1=0;P0=0;P25=1;TR0=1;}
168 5 }
169 4 else
170 4 { if(j==4)
171 5 { P0=96;P25=0;}
172 5 if(j==5)
173 5 { P0=8*led[0];P25=0;}
174 5 if(j==6)
175 5 {P0=104;P25=0;}
176 5 if(j==7)
177 5 { j=0;TR1=0;P0=0;P25=1;TR0=1;}
178 5 }
C51 COMPILER V7.06 WENDU 06/09/2007 00:50:12 PAGE 4
179 4 }
180 3 else
181 3 { if(j==4)
182 4 { P0=8*led[1]; P25=0;}
183 4 if(j==5)
184 4 { P0=96;P25=0;}
185 4 if(j==6)
186 4 { P0=8*led[0];P25=0;}
187 4 if(j==7)
188 4 { P0=104 ; P25=0;}
189 4 if(j==8)
190 4 { j=0; TR1=0; P0=0;P25=1;TR0=1;}
191 4 }
192 3 }
193 2 }
194 1 }
195 void main(void)
196 {
197 1 initlcd();//初始化
198 1 clear();//清屏
199 1 gotoxy(1,0);//顯示第1行
200 1 for(i=0;i<10;i++) WRdata(tab1[i]);
201 1 gotoxy(2,0);//顯示第2行
202 1 for(i=0;i<10;i++) WRdata(tab2[i]);
203 1 init();
204 1 P0=0X00;
205 1 while(1)
206 1 {
207 2 key();
208 2 ad574();
209 2 gotoxy(1,5);
210 2 WRdata(number[t/100]);
211 2 gotoxy(1,6);
212 2 WRdata(number[t%100/10]);
213 2 gotoxy(1,7);
214 2 WRdata(number[10]);
215 2 gotoxy(1,8);
216 2 WRdata(number[t%10]);
217 2 gotoxy(2,5);
218 2 WRdata(number[cw/100]);
219 2 gotoxy(2,6);
220 2 WRdata(number[cw%100/10]);
221 2 gotoxy(2,7);
222 2 WRdata(number[10]);
223 2 gotoxy(2,8);
224 2 WRdata(number[cw%10]);
225 2 if(K1==1)
226 2 { WRdata(0x0f);
227 3 WRdata(0xc5);
228 3 gotoxy(2,5);
229 3 WRdata(number[cw/100]);
230 3 gotoxy(2,6);
231 3 WRdata(number[cw%100/10]);
232 3 delay(5);
233 3 WRdata(0x0c);
234 3 }
235 2
236 2 }
237 1 }
238
239
C51 COMPILER V7.06 WENDU 06/09/2007 00:50:12 PAGE 5
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1298 ----
CONSTANT SIZE = 12 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 47 1
IDATA SIZE = ---- ----
BIT SIZE = 3 ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -