?? dds.lst
字號:
C51 COMPILER V7.06 DDS 04/21/2009 14:42:16 PAGE 1
C51 COMPILER V7.06, COMPILATION OF MODULE DDS
OBJECT MODULE PLACED IN dds.OBJ
COMPILER INVOKED BY: D:\mcu\C51\BIN\C51.EXE dds.c BROWSE DEBUG OBJECTEXTEND
stmt level source
1 #include<AT89X52.h>
2 //#include<lcd.h>
3 #include<1302.h>
4 #include<music_code.h>
5 #include<SoundPlay.h>
6 //#include<dds.h>
7 #include<lcd1.h>
8 uchar code time[]={'0','1','2','3','4','5','6','7','8','9'};
9 uchar code get_up[]="Time to Get up!";
10 uchar code str[]="Never frown,even when you are sad,because you never know who is falling in love with you
-r smile! To the world you are one person,but to one person you may be the world ";
11 uchar code menu[5][8]={{"校時"},{"鈴聲"},{"電子書"},{"鬧鐘"},{"日歷"}};
12 uchar code daytab[7][3]= {"一","二","三","四","五","六","日"};
13 void main()
14 {
15 1 PSB=0;
16 1 lcddelay(300);
17 1 PSB=1;
18 1 RW=0;
19 1 lcdreset(); //初始化LCD屏
20 1 //CGRAM(); //調(diào)用自定義的CGRAM的代碼
21 1 ceshi(); //顯示測試字樣
22 1 lcddelay(2000);
23 1 clrgdram();
24 1 clrscreen();
25 1 Disp_Img(BMP1); //調(diào)入一幅圖畫
26 1 lcddelay(20000);
27 1 clrscreen();
28 1 init_ds1302();
29 1 set_ds1302(time_add,initial_time);
30 1 while(1)
31 1 {
32 2 read_ring();
33 2 if(alarmsign)
34 2 if(ring_time[0]==now_time[0]&&ring_time[1]==now_time[1]&&ring_time[2]==now_time[2])
35 2 {
36 3 timeup();
37 3 }
38 2 detect();
39 2 write_com(0x80+0x3);
40 2 hzkdis(menu[key]);
41 2 get_ds1302();
42 2 now_week=getweek(now_time[5]/16*10+now_time[5]%16+2000,now_time[4]/16*10+now_time[4]%16,now_time[3]/16*1
-0+now_time[3]%16);
43 2 write_com(0x91);
44 2 write_data(time[now_time[5]>>4]);
45 2 write_data(time[now_time[5]&0x0f]);
46 2 hzkdis("年");
47 2 write_data(time[now_time[4]>>4]);
48 2 write_data(time[now_time[4]&0x0f]);
49 2 hzkdis("月");
50 2 write_data(time[now_time[3]>>4]);
51 2 write_data(time[now_time[3]&0x0f]);
52 2 hzkdis("日");
53 2 write_com(0x8a);
C51 COMPILER V7.06 DDS 04/21/2009 14:42:16 PAGE 2
54 2 write_data(time[now_time[2]>>4]);
55 2 write_data(time[now_time[2]&0x0f]);
56 2 write_data(':');
57 2 write_data(time[now_time[1]>>4]);
58 2 write_data(time[now_time[1]&0x0f]);
59 2 write_data(':');
60 2 write_data(time[now_time[0]>>4]);
61 2 write_data(time[now_time[0]&0x0f]);
62 2 write_com(0x98);
63 2 if(alarmsign==1)
64 2 hzkdis("AO ");
65 2 else
66 2 hzkdis("AC ");
67 2 write_data(time[ring_time[2]>>4]);
68 2 write_data(time[ring_time[2]&0x0f]);
69 2 write_data(':');
70 2 write_data(time[ring_time[1]>>4]);
71 2 write_data(time[ring_time[1]&0x0f]);
72 2 write_com(0x9d);
73 2 hzkdis("星期");
74 2 hzkdis(daytab[now_week-1]);
75 2 if(key==2)
76 2 {
77 3 book();
78 3 }
79 2 if(key==1)
80 2 {
81 3 music();
82 3
83 3 }
84 2 if(key==3)
85 2 {
86 3 alamn();
87 3
88 3 }
89 2 if(key==0)
90 2 {
91 3 time_set();
92 3
93 3 }
94 2 if(key==4)
95 2 {
96 3 rili();
97 3 }
98 2 }
99 1 }
100 void detect()
101 {
102 1 uchar temp;
103 1 temp=P2;
104 1 temp=temp&0x3f;
105 1 if(temp!=0x3f)
106 1 {
107 2 switch(temp)
108 2 {
109 3 case 0x3e:
110 3 while(temp!=0x3f)
111 3 {
112 4 temp=P2;
113 4 temp=temp&0x3f;
114 4 }
115 3 key++;
C51 COMPILER V7.06 DDS 04/21/2009 14:42:16 PAGE 3
116 3 if(key==5)
117 3 {
118 4 key=0;
119 4 }
120 3 flag=1;
121 3 clrscreen();
122 3 break;
123 3 case 0x3d:
124 3 while(temp!=0x3f)
125 3 {
126 4 temp=P2;
127 4 temp=temp&0x3f;
128 4 }
129 3 if(key==0)
130 3 {
131 4 key=5;
132 4 }
133 3 key--;
134 3 flag=2;
135 3 clrscreen();
136 3 break;
137 3
138 3 case 0x3b:
139 3 while(temp!=0x3f)
140 3 {
141 4 temp=P2;
142 4 temp=temp&0x3f;
143 4 }
144 3 flag=3;
145 3 clrscreen();
146 3 break;
147 3 case 0x37:
148 3 while(temp!=0x3f)
149 3 {
150 4 temp=P2;
151 4 temp=temp&0x3f;
152 4 }
153 3 flag=4;
154 3 clrscreen();
155 3 break;
156 3
157 3 case 0x2f:
158 3 while(temp!=0x3f)
159 3 {
160 4 temp=P2;
161 4 temp=temp&0x3f;
162 4 }
163 3 flag=5;
164 3 clrscreen();
165 3 break;
166 3 case 0x1f:
167 3 while(temp!=0x3f)
168 3 {
169 4 temp=P2;
170 4 temp=temp&0x3f;
171 4 }
172 3 flag=6;
173 3 clrscreen();
174 3 break;
175 3 }
176 2 }
177 1
C51 COMPILER V7.06 DDS 04/21/2009 14:42:16 PAGE 4
178 1 }
179 void page(uchar k)
180 {
181 1 write_com(0x80);
182 1 for(i=k*64;i<k*64+16&&str[i]!='\0';i++)
183 1 {
184 2 write_data(str[i]);
185 2 }
186 1 write_com(0x90);
187 1 for(i=k*64+16;i<k*64+32&&str[i]!='\0';i++)
188 1 {
189 2 write_data(str[i]);
190 2 }
191 1 write_com(0x88);
192 1 for(i=k*64+32;i<k*64+48&&str[i]!='\0';i++)
193 1 {
194 2 write_data(str[i]);
195 2 }
196 1 write_com(0x98);
197 1 for(i=k*64+48;i<k*64+64&&str[i]!='\0';i++)
198 1 {
199 2 write_data(str[i]);
200 2 }
201 1
202 1 }
203
204 void book()
205 {
206 1
207 1 flag=0;
208 1 detect();
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -