📄 12232.lst
字号:
259 1 for (page=0;page<4;page++)
260 1 {
261 2 SetPage(page,page);
262 2 SetAddress(0,0);
263 2 for (i=0;i<61;i++){PutCharR(0);PutCharL(0);}
264 2 }
265 1 }
266
267 //-----------------------------------------------------------
268 //图片显示
269 //采用字模2生成或字模3生成的都可以.
270 //-----------------------------------------------------------
271 void DrawBmp1(uint x_add, uchar width,uchar *bmp)
272 {
273 1 uchar x,address,i=0; //address表示显存的物理地址
274 1 uchar page=0; //page表示上下两页
275 1 bit window=0; //window表示左右两页
276 1 //putcharR //右边
277 1 //putcharL //左边
278 1 for (x=width;x>1;x--)
279 1 {
280 2 if (x_add>60) {window=1;address=x_add%61;}
281 2 else address=x_add;
282 2
283 2
284 2 SetPage(0,0);
285 2 SetAddress(address,address);
286 2 if(window==1)PutCharR(bmp[i]);
287 2 else PutCharL(bmp[i]);
288 2 SetPage(1,1);
289 2 SetAddress(address,address);
290 2 if(window==1)PutCharR(bmp[i+width]);
291 2 else PutCharL(bmp[i+width]);
292 2
293 2
294 2 SetPage(2,2);
295 2 SetAddress(address,address);
296 2 if(window==1)PutCharR(bmp[i+width+width]);
297 2 else PutCharL(bmp[i+width+width]);
298 2 SetPage(3,3);
299 2 SetAddress(address,address);
300 2 if(window==1)PutCharR(bmp[i+width+width+width]);
301 2 else PutCharL(bmp[i+width+width+width]);
302 2 i++;
303 2 x_add++;
C51 COMPILER V7.07 12232 05/18/2004 09:55:26 PAGE 6
304 2
305 2 }
306 1 }
307
308 //---------------------------------------------------------------
309 //---------------------------------------------------------------
310 //采用zimo2 显示汉字,以汉字的显示方式
311 //void Draw_word(uchar d_where,uint x_add,bit layer,uchar width)
312 //d_where表示在码表中第几个汉字,x_add横坐标位置,layer显示的层, width显示的宽度。
313 //---------------------------------------------------------------
314
315
316 void Draw_word(uchar d_where,uint x_add,bit layer,uchar width)
317 {
318 1 uchar x,i=0,address; //address表示显存的物理地址
319 1 uchar page=0; //page表示上下两页
320 1 bit window=0; //window表示左右两页
321 1 //putcharR //右边
322 1 //putcharL //左边
323 1 d_where=d_where*32;
324 1
325 1 for (x=width;x>1;x--)
326 1 {
327 2 if (x_add>60) {window=1;address=x_add%61;}
328 2 else address=x_add;
329 2
330 2 if(layer==0) //显示一行八个字
331 2 {
332 3
333 3 SetPage(0,0);
334 3 SetAddress(address,address);
335 3 if(window==1)PutCharR(bmp001[d_where]);//右边
336 3 else PutCharL(bmp001[d_where]);//左边
337 3 SetPage(1,1);
338 3 SetAddress(address,address);
339 3 if(window==1)PutCharR(bmp001[d_where+width]);
340 3 else PutCharL(bmp001[d_where+width]);
341 3
342 3 }
343 2 else
344 2 { //显示第二行八个汉字
345 3 SetPage(2,2);
346 3 SetAddress(address,address);
347 3 if(window==1)PutCharR(bmp001[d_where]);//右边
348 3 else PutCharL(bmp001[d_where]);//左边
349 3 SetPage(3,3);
350 3 SetAddress(address,address);
351 3 if(window==1)PutCharR(bmp001[d_where+width]);
352 3 else PutCharL(bmp001[d_where+width]);
353 3
354 3 }
355 2 x_add++;
356 2 d_where++;
357 2 }
358 1 }
359 /*
360 //------------------------------------------------------------------
361 //字模2显示一个汉字
362 //纵向取模,字节倒序
363 void disp_one(bit top_low,bit widows,uchar address,uchar width,uchar*bmp)
364 {
365 if(top_low==0)
C51 COMPILER V7.07 12232 05/18/2004 09:55:26 PAGE 7
366 {
367 SetPage(0,0);
368 SetAddress(address,address);
369 if(window==1)PutCharR(bmp001[next][i]);
370 else PutCharL(bmp001[next][i]);
371 SetPage(1,1);
372 SetAddress(address,address);
373 if(window==1)PutCharR(bmp001[next][i+width]);
374 else PutCharL(bmp001[next][i+width]);
375 }
376 else
377 {
378 SetPage(0,0);
379 SetAddress(address,address);
380 if(window==1)PutCharR(bmp001[next][i]);
381 else PutCharL(bmp001[next][i]);
382 SetPage(1,1);
383 SetAddress(address,address);
384 if(window==1)PutCharR(bmp001[next][i+width]);
385 else PutCharL(bmp001[next][i+width]);
386 }
387 }
388 */
389
390
391
392
393 //液晶显示规则
394 // M(左) S(右)
395 // page page
396 // 0 | 0
397 // 1 | 1
398 // 2 | 2
399 // 3 | 3
400
401 void delay1s(unsigned char i)
402 {
403 1 while(i>1)
404 1 {
405 2 i--;
406 2
407 2 delay(65530);
408 2 }
409 1 }
410
411 //显示动态的等待图标
412 void wait1(unsigned char i)
413 {
414 1 for(;i>1;i--)
415 1 {delay1s(2);
416 2 clrscr(); //
417 2 DrawBmp1(0,60,Bmptc); //
418 2 DrawBmp1(76,19,Bmpt1); //
419 2 delay1s(2);
420 2 clrscr(); //
421 2 DrawBmp1(0,60,Bmptc); //
422 2 DrawBmp1(76,19,Bmpt2); //
423 2 delay1s(2);
424 2 clrscr(); //
425 2 DrawBmp1(0,60,Bmptc); //
426 2 DrawBmp1(76,19,Bmpt3); //
427 2 delay1s(2);
C51 COMPILER V7.07 12232 05/18/2004 09:55:26 PAGE 8
428 2 clrscr(); //
429 2 DrawBmp1(0,60,Bmptc); //
430 2 DrawBmp1(76,19,Bmpt4); //
431 2 delay1s(2);
432 2 clrscr(); //
433 2 DrawBmp1(0,60,Bmptc); //
434 2 DrawBmp1(76,19,Bmpt5); //
435 2 delay1s(2);
436 2 clrscr(); //
437 2 DrawBmp1(0,60,Bmptc); //
438 2 DrawBmp1(76,19,Bmpt6); //
439 2 delay1s(2);
440 2 clrscr(); //
441 2 DrawBmp1(0,60,Bmptc); //
442 2 DrawBmp1(76,19,Bmpt7); //
443 2 }
444 1
445 1 }
446
447
448 //演示程序
449 void main()
-
450 {
451 1
452 1 lcdini(); //reset
453 1 clrscr(); //clr
454 1
455 1
456 1 Draw_word(0,0,0,16); //
457 1 Draw_word(1,16,0,16); //
458 1 Draw_word(2,32,0,16); //
459 1 Draw_word(3,48,0,16); //
460 1 Draw_word(0,64,0,16); //
461 1 Draw_word(1,80,0,16); //
462 1 Draw_word(2,96,0,16); //
463 1
464 1 DrawBmp(1,120,Bmp002); //
465 1 clrscr(); //
466 1 delay1s(3);
467 1 DrawBmp1(0,122,Bmp012); //LOGO
468 1 // while(1) ;
469 1
470 1 while(1)
471 1 {
472 2 delay1s(3);
473 2
474 2 clrscr(); //
475 2 DrawBmp1(10,101,Bmp07); //
476 2
477 2 delay1s(8);
478 2 clrscr(); //
479 2 wait1(3);
480 2 DrawBmp1(0,122,Bmp04); //
481 2 delay1s(8);
482 2 clrscr(); //
483 2 wait1(3);
484 2 DrawBmp1(0,122,Bmp03); //超前科技
485 2 delay1s(8);
486 2 clrscr(); //
487 2 wait1(3);
488 2 clrscr(); //
C51 COMPILER V7.07 12232 05/18/2004 09:55:26 PAGE 9
489 2 DrawBmp1(10,101,Bmp05); //
490 2 delay1s(8);
491 2 clrscr(); //
492 2 wait1(3);
493 2 clrscr(); //
494 2 DrawBmp1(10,101,Bmp06); //
495 2 delay1s(8);
496 2 clrscr(); //
497 2 wait1(3);
498 2 clrscr(); //
499 2 DrawBmp1(10,101,Bmp08); //
500 2 delay1s(8);
501 2 clrscr(); //
502 2 wait1(3);
503 2 clrscr(); //
504 2 DrawBmp1(0,122,Bmp01); //这仿真器真不错,用过都说好.
505 2 wait1(8);
506 2 }
507 1 }
508
509
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 1408 ----
CONSTANT SIZE = ---- ----
XDATA SIZE = ---- ----
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 + -