📄 123.lst
字号:
C51 COMPILER V7.06 123 05/08/2008 15:40:26 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE 123
OBJECT MODULE PLACED IN 123.OBJ
COMPILER INVOKED BY: C:\Keil\C51\BIN\C51.EXE 123.C BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include <reg52.h>
2 #include "define.h"
3 #include "asc_zimo.h"
4 #include "Hz_zimo.h"
5 #include "lcd.c"
6 #include "touch.c"
7 #include "liu.c"
8 #include "t18b20.c"
9
10 uint T_x = 3;
11 uint T_y = 4;
12 static unsigned char time[7]={0x00,0x55,0x13,0x07,0x05,0x3,0x08};
13
14 void set_time(unsigned char *time)
15 {
16 1 static unsigned char i=0,j,time_s[12];
17 1 static unsigned int color[12];
18 1 while(!touch_INT);//有触摸touch_INT=0;
19 1 while(1)
20 1 {
21 2 if(touch_INT==0)
22 2 {
23 3 touch_GetAdXY(&T_x, &T_y);
24 3 if((T_x<900)&&(T_x>400)&&(T_y<1120)&&(T_y>260))
25 3 {
26 4 time[0] = time_s[0]|(time_s[1]<<4);
27 4 time[1] = time_s[2]|(time_s[3]<<4);
28 4 time[2] = time_s[4]|(time_s[5]<<4);
29 4 time[3] = time_s[6]|(time_s[7]<<4);
30 4 time[4] = time_s[8]|(time_s[9]<<4);
31 4 time[6] = time_s[10]|(time_s[11]<<4);
32 4 Set1302(time);
33 4 return;
34 4 }
35 3 if((T_x<900)&&(T_x>400)&&(T_y<2500)&&(T_y>1500))
36 3 i++;
37 3 if((T_x<900)&&(T_x>400)&&(T_y<3700)&&(T_y>2800))
38 3 time_s[i]++;
39 3 if(i>=12)
40 3 i = 0;
41 3 if(time_s[i]>=10)
42 3 time_s[i] = 0;
43 3 }
44 2 for(j=0;j<12;j++)
45 2 {
46 3 color[j] = 0x333333;
47 3 color[i] = 0xff;
48 3 }
49 2 DisNum(220, 230, time_s[0], color[0]);//秒,个位
50 2
51 2 DisNum(212, 230, time_s[1], color[1]);//秒,十位
52 2
53 2 DisNum(196,230,time_s[2], color[2]); //分,个位
54 2
55 2 DisNum(188,230,time_s[3], color[3]); //分,十位
C51 COMPILER V7.06 123 05/08/2008 15:40:26 PAGE 2
56 2
57 2 DisNum(172,230,time_s[4], color[4]); //小时,个位
58 2
59 2 DisNum(164,230,time_s[5], color[5]); //小时,十位
60 2
61 2 DisNum(220,210,time_s[6], color[6]); //日,个位
62 2
63 2 DisNum(212,210,time_s[7], color[7]); //日,十位
64 2
65 2 DisNum(196,210,time_s[8], color[8]); //月,个位
66 2
67 2 DisNum(188,210,time_s[9], color[9]); //月,十位
68 2
69 2 DisNum(172,210,time_s[10], color[10]); //年,个位
70 2
71 2 DisNum(164,210,time_s[11], color[11]); //年,十位
72 2 }
73 1 }
74
75
76
77 main()
78 {
79 1 uchar temp;
80 1 uchar R_data=0;
81 1 uchar G_data=0;
82 1 uchar B_data=0;
83 1 uchar temper;
84 1
85 1 uint i,j,k=0;
86 1 res=0; //低电平复位
87 1 DelayNS(1000);
88 1 res=1;
89 1 send_command(0x00);
90 1 i=rece_data();
91 1
92 1 DelayNS(10000);//等待电源恢复正常
93 1
94 1 lcd_init();
95 1 touch_Init();
96 1 PWM=1;//电机初始化,停止转动
97 1 DispClear();
98 1 DispOneColor(0x333333);
99 1
100 1 Set_ramaddr(0,0);
101 1 send_command(0x22);
102 1 for(j=0;j<50;j++)
103 1 for(i=0;i<240;i++)
104 1 send_data(GREEN);
105 1
106 1 DrawString(0, 150, "现", WHITE, 0x333333, NORMAL);
107 1 DrawString(16, 150, "在", WHITE, 0x333333, NORMAL);
108 1 DrawString(32, 150, "气", WHITE, 0x333333, NORMAL);
109 1 DrawString(48, 150, "温", WHITE, 0x333333, NORMAL);
110 1 DrawString(64, 150, ":", WHITE, 0x333333, NORMAL);
111 1 DrawString(88, 143, ".", WHITE, 0x333333, NORMAL);
112 1 DrawString(96, 150, "C", WHITE, 0x333333, NORMAL);
113 1
114 1 for(j=270;j<310;j++)
115 1 {
116 2 Set_ramaddr(10,j);
117 2 send_command(0x22);
C51 COMPILER V7.06 123 05/08/2008 15:40:26 PAGE 3
118 2 for(i=10;i<70;i++)
119 2 send_data(RED);
120 2 }
121 1 DrawString(24, 282, "设", WHITE, RED, NORMAL);
122 1 DrawString(40, 282, "定", WHITE, RED, NORMAL);
123 1
124 1 for(j=270;j<310;j++)
125 1 {
126 2 Set_ramaddr(90,j);
127 2 send_command(0x22);
128 2 for(i=90;i<150;i++)
129 2 send_data(RED);
130 2 }
131 1 DrawString(104, 282, "左", WHITE, RED, NORMAL);
132 1 DrawString(120, 282, "移", WHITE, RED, NORMAL);
133 1
134 1 for(j=270;j<310;j++)
135 1 {
136 2 Set_ramaddr(170,j);
137 2 send_command(0x22);
138 2 for(i=170;i<230;i++)
139 2 send_data(RED);
140 2 }
141 1 DrawString(184, 282, "调", WHITE, RED, NORMAL);
142 1 DrawString(200, 282, "整", WHITE, RED, NORMAL);
143 1
144 1 Set1302(time);
145 1
146 1 while(1)
147 1 {
148 2 Get1302(time);
149 2 DispNum(148,210,2);
150 2 DispNum(156,210,0);
151 2 temp = time[6]>>4;
152 2 DispNum(164,210,temp);
153 2 temp = time[6]&0x0f;
154 2 DispNum(172,210,temp); //年
155 2 DrawString(180,210,"-",WHITE,0x333333,NORMAL);
156 2 temp = time[4]>>4;
157 2 DispNum(188,210,temp); //月,十位
158 2 temp = time[4]&0x0f;
159 2 DispNum(196,210,temp); //月,个位
160 2 DrawString(204,210,"-",WHITE,0x333333,NORMAL);
161 2 temp = time[3]>>4;
162 2 DispNum(212,210,temp); //日,十位
163 2 temp = time[3]&0x0f;
164 2 DispNum(220,210,temp); //日,个位
165 2 temp = time[2]>>4;
166 2 DispNum(164,230,temp); //小时,十位
167 2 temp = time[2]&0x0f;
168 2 DispNum(172,230,temp); //小时,个位
169 2 DrawString(180,230,":",WHITE,0x333333,NORMAL);
170 2 temp = time[1]>>4;
171 2 DispNum(188,230,temp); //分,十位
172 2 temp = time[1]&0x0f;
173 2 DispNum(196,230,temp); //分,个位
174 2 DrawString(204,230,":",WHITE,0x333333,NORMAL);
175 2 temp = time[0]>>4;
176 2 DispNum(212, 230, temp);//秒,十位
177 2 temp = time[0]&0x0f;
178 2 DispNum(220, 230, temp);//秒,个位
179 2
C51 COMPILER V7.06 123 05/08/2008 15:40:26 PAGE 4
180 2 temper = ReadTemperature();
181 2 DispNum(72,150,temper/10);
182 2 DispNum(80,150,temper%10);
183 2
184 2 if (touch_INT==0)
185 2 {
186 3 touch_GetAdXY(&T_x, &T_y);
187 3 if((T_x<900)&&(T_x>400)&&(T_y<1200)&&(T_y>300))
188 3 set_time(time);
189 3 }
190 2 if (temper>=25)//直流电机
191 2 PWM=0;
192 2 else
193 2 PWM=~PWM;
194 2 }
195 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 3531 ----
CONSTANT SIZE = 2241 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 49 87
IDATA SIZE = ---- ----
BIT SIZE = ---- ----
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -