📄 12232.lst
字号:
246 //图片显示
247 //采用字模2生成或字模3生成的都可以.
248 //-----------------------------------------------------------
249 void DrawBmp1(uint x_add, uchar width,uchar *bmp)
250 {
251 1 uchar x,address,i=0; //address表示显存的物理地址
252 1 uchar page=0; //page表示上下两页
253 1 bit window=0; //window表示左右两页
254 1 //putcharR //右边
255 1 //putcharL //左边
256 1 for (x=width;x>1;x--)
257 1 {
258 2 if (x_add>60) {window=1;address=x_add%61;}
259 2 else address=x_add;
260 2
261 2
262 2 SetPage(0,0);
263 2 SetAddress(address,address);
264 2 if(window==1)PutCharR(bmp[i]);
265 2 else PutCharL(bmp[i]);
266 2 SetPage(1,1);
267 2 SetAddress(address,address);
268 2 if(window==1)PutCharR(bmp[i+width]);
269 2 else PutCharL(bmp[i+width]);
270 2
271 2
272 2 SetPage(2,2);
273 2 SetAddress(address,address);
274 2 if(window==1)PutCharR(bmp[i+width+width]);
275 2 else PutCharL(bmp[i+width+width]);
276 2 SetPage(3,3);
277 2 SetAddress(address,address);
278 2 if(window==1)PutCharR(bmp[i+width+width+width]);
279 2 else PutCharL(bmp[i+width+width+width]);
280 2 i++;
281 2 x_add++;
282 2
283 2 }
284 1 }
285
286 //---------------------------------------------------------------
287 //---------------------------------------------------------------
288 //采用zimo3 显示汉字,以汉字的显示方式
289 //void Draw_word(uchar d_where,uint x_add,bit layer,uchar width)
290 //d_where表示在码表中第几个汉字,x_add横坐标位置,layer显示的层, width显示的宽度。
291 //---------------------------------------------------------------
292
293
294 void Draw_word(uchar d_where,uint x_add,bit layer,uchar width)
295 {
296 1 uchar x,i=0,address; //address表示显存的物理地址
297 1 uchar page=0; //page表示上下两页
298 1 bit window=0; //window表示左右两页
299 1 //putcharR //右边
300 1 //putcharL //左边
301 1 d_where=d_where*32;
302 1
303 1 for (x=width;x>1;x--)
C51 COMPILER V7.08 12232 10/18/2006 17:09:25 PAGE 6
304 1 {
305 2 if (x_add>60) {window=1;address=x_add%61;}
306 2 else address=x_add;
307 2
308 2 if(layer==0) //显示一行八个字
309 2 {
310 3
311 3 SetPage(0,0);
312 3 SetAddress(address,address);
313 3 if(window==1)PutCharR(bmp001[d_where]);//右边
314 3 else PutCharL(bmp001[d_where]);//左边
315 3 SetPage(1,1);
316 3 SetAddress(address,address);
317 3 if(window==1)PutCharR(bmp001[d_where+width]);
318 3 else PutCharL(bmp001[d_where+width]);
319 3
320 3 }
321 2 else
322 2 { //显示第二行八个汉字
323 3 SetPage(2,2);
324 3 SetAddress(address,address);
325 3 if(window==1)PutCharR(bmp001[d_where]);//右边
326 3 else PutCharL(bmp001[d_where]);//左边
327 3 SetPage(3,3);
328 3 SetAddress(address,address);
329 3 if(window==1)PutCharR(bmp001[d_where+width]);
330 3 else PutCharL(bmp001[d_where+width]);
331 3
332 3 }
333 2 x_add++;
334 2 d_where++;
335 2 }
336 1 }
337 /*
338 //------------------------------------------------------------------
339 //字模2显示一个汉字
340 //纵向取模,字节倒序
341 void disp_one(bit top_low,bit widows,uchar address,uchar width,uchar*bmp)
342 {
343 if(top_low==0)
344 {
345 SetPage(0,0);
346 SetAddress(address,address);
347 if(window==1)PutCharR(bmp001[next][i]);
348 else PutCharL(bmp001[next][i]);
349 SetPage(1,1);
350 SetAddress(address,address);
351 if(window==1)PutCharR(bmp001[next][i+width]);
352 else PutCharL(bmp001[next][i+width]);
353 }
354 else
355 {
356 SetPage(0,0);
357 SetAddress(address,address);
358 if(window==1)PutCharR(bmp001[next][i]);
359 else PutCharL(bmp001[next][i]);
360 SetPage(1,1);
361 SetAddress(address,address);
362 if(window==1)PutCharR(bmp001[next][i+width]);
363 else PutCharL(bmp001[next][i+width]);
364 }
365 }
C51 COMPILER V7.08 12232 10/18/2006 17:09:25 PAGE 7
366 */
367
368 //液晶显示规则
369 // M(左) S(右)
370 // page page
371 // 0 | 0
372 // 1 | 1
373 // 2 | 2
374 // 3 | 3
375
376 void delay1s(unsigned char i)
377 {
378 1 while(i>1)
379 1 {
380 2 i--;
381 2
382 2 delay(65530);
383 2 }
384 1 }
385
386 //显示动态的等待图标
387 void wait1(unsigned char i)
388 {
389 1 for(;i>1;i--)
390 1 {delay1s(1);
391 2 clrscr(); //
392 2 DrawBmp1(0,60,Bmptc); //
393 2 DrawBmp1(76,19,Bmpt1); //
394 2 delay1s(1);
395 2 clrscr(); //
396 2 DrawBmp1(0,60,Bmptc); //
397 2 DrawBmp1(76,19,Bmpt2); //
398 2 delay1s(1);
399 2 clrscr(); //
400 2 DrawBmp1(0,60,Bmptc); //
401 2 DrawBmp1(76,19,Bmpt3); //
402 2 delay1s(1);
403 2 clrscr(); //
404 2 DrawBmp1(0,60,Bmptc); //
405 2 DrawBmp1(76,19,Bmpt4); //
406 2 delay1s(1);
407 2 clrscr(); //
408 2 DrawBmp1(0,60,Bmptc); //
409 2 DrawBmp1(76,19,Bmpt5); //
410 2 delay1s(1);
411 2 clrscr(); //
412 2 DrawBmp1(0,60,Bmptc); //
413 2 DrawBmp1(76,19,Bmpt6); //
414 2 delay1s(1);
415 2 clrscr(); //
416 2 DrawBmp1(0,60,Bmptc); //
417 2 DrawBmp1(76,19,Bmpt7); //
418 2 }
419 1
420 1 }
421
422
423 //演示程序
424 void main()
-
425 {
426 1 lcdini(); //reset
C51 COMPILER V7.08 12232 10/18/2006 17:09:25 PAGE 8
427 1 clrscr(); //clr
428 1 E=1;
429 1 //Draw_word(0,8,0,16); //
430 1 // Draw_word(1,25,0,16); //
431 1 // Draw_word(2,41,0,16); //
432 1 // Draw_word(3,57,0,16); //
433 1 //Draw_word(0,64,0,16); //
434 1 //Draw_word(1,80,0,16); //
435 1 //Draw_word(2,96,0,16); //
436 1
437 1 //DrawBmp(1,120,Bmp002); //
438 1 //clrscr(); //
439 1 //delay1s(3);
440 1 //DrawBmp1(0,30,Bmpt8); //
441 1 //DrawBmp1(0,122,Bmp012); //LOGO
442 1 // while(1) ;
443 1 while(1)
444 1 {
445 2 delay1s(1);
446 2 clrscr(); //
447 2 // DrawBmp1(10,101,Bmp07); //
448 2
449 2 // delay1s(8);
450 2 // clrscr(); //
451 2 // wait1(3);
452 2 DrawBmp1(0,122,Bmp04); //
453 2 delay1s(4);
454 2 clrscr(); //
455 2 // wait1(3);
456 2 DrawBmp1(0,122,Bmp02); //
457 2 delay1s(4);
458 2 clrscr(); //
459 2 // wait1(3);
460 2 // clrscr(); //
461 2 DrawBmp1(0,122,Bmp03); //
462 2 delay1s(4);
463 2 // clrscr(); //
464 2 // wait1(3);
465 2 clrscr(); //
466 2 // DrawBmp1(0,122,Bmp05); //
467 2 // delay1s(4);
468 2 // clrscr(); //
469 2 // wait1(3);
470 2 clrscr(); //
471 2 DrawBmp1(0,122,Bmp01); //
472 2 delay1s(4);
473 2 clrscr(); //
474 2 // wait1(3);
475 2 clrscr(); //
476 2 DrawBmp1(0,122,Bmp06); //
477 2 //wait1(8);
478 2 delay1s(4);
479 2 }
480 1 }
481
482
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1275 ----
CONSTANT SIZE = 5120 ----
XDATA SIZE = ---- ----
C51 COMPILER V7.08 12232 10/18/2006 17:09:25 PAGE 9
PDATA SIZE = ---- ----
DATA SIZE = ---- 26
IDATA SIZE = ---- ----
BIT SIZE = ---- 5
END OF MODULE INFORMATION.
C51 COMPILATION COMPLETE. 0 WARNING(S), 0 ERROR(S)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -