📄 tset.lst
字号:
454 { unsigned char x,y;
455 1 unsigned char k=0x00;
456 1 for(y=0;y<32;y++)
457 1 { k=~k;
458 2 for(x=0;x<16;x++)
459 2 { write_com(0x36);
460 3 write_com(y+0x80); //???
461 3 write_com(x+0x80); //???
462 3 write_com(0x30);
463 3 write_data(k);
464 3 write_data(k);
465 3 };
466 2 }
467 1 write_com(0x34);
468 1 write_com(0x36);
469 1 }
470 /*------------------显示边框-------------------------------*/
471 void Frame()
472 {
473 1 unsigned char x,y;
474 1 lcdfill(0x00);
475 1 for(x=0;x<9;x+=8)
476 1 for(y=0;y<32;y++)
477 1 {write_com(0x36);
478 2 write_com(y+0x80); //行地址
479 2 write_com(x+0x80); //列地址
480 2 write_com(0x30);
481 2 write_data(0x80);
482 2 write_data(0x00);
483 2
484 2 write_com(0x36);
485 2 write_com(y+0x80); //行地址
486 2 write_com(x+0x87); //列地址
487 2 write_com(0x30);
488 2 write_data(0x00);
489 2 write_data(0x01);
C51 COMPILER V8.06 TSET 09/08/2007 09:17:55 PAGE 9
490 2
491 2 }
492 1 for(y=0;y<2;y++)
493 1 for(x=0;x<8;x++)
494 1 {write_com(0x36);
495 2 write_com(y*31+0x80); //行地址
496 2 write_com(x+0x80+8*y); //列地址
497 2 write_com(0x30);
498 2 write_data(0xff);
499 2 write_data(0xff);
500 2 }
501 1 write_com(0x34);
502 1 write_com(0x36);
503 1 }
504
505 /*------------------在第七列位置加入两列竖线--------------------------*/
506 void shuxian()
507 { unsigned char x,y;
508 1
509 1 for(x=0;x<9;x+=8)
510 1 for(y=0;y<32;y++)
511 1 { write_com(0x36);
512 2 write_com(y+0x80); //行地址
513 2 write_com(x+0x86); //列地址
514 2 write_com(0x30);
515 2 write_data(0x00);
516 2 write_data(0x14);
517 2 };
518 1 }
519
520 /*------------------清屏命令--------------------------*/
521 void clrscreen()
522 {
523 1 write_com(0x01);
524 1 delay(10);
525 1 }
526
527 /*------------------古诗-------------------------*/
528 void gushi_display()
529 { write_com(0x30);
530 1 clrscreen();
531 1
532 1 }
533
534 main()
535 { unsigned char i;
536 1 PSB=1;
537 1 REST=0;
538 1 delay(100);
539 1 REST=1;
540 1 while(1)
541 1 {
542 2 RW=0;
543 2 lcdreset(); //初始化LCD屏幕
544 2 CGRAM();
545 2 ceshi(); //显示测试字样
546 2 write_com(0x0c); //关闭游标显示
547 2 delay(20000);
548 2
549 2
550 2
551 2 // clrgdram();
C51 COMPILER V8.06 TSET 09/08/2007 09:17:55 PAGE 10
552 2 // clrscreen(); //清屏
553 2 // Disp_Img(BMP); //显示画
554 2 // delay(10000);
555 2
556 2 //Disp_Img(BMP1); //??????
557 2 // delay(10000);
558 2 while(1);
559 2 //while(1);
560 2
561 2
562 2 // lcdfill(0xff); //显示全开
563 2 // delay(10000);
564 2 //
565 2 // Disp_H_Line(); //显示横条
566 2 // delay(10000);
567 2
568 2
569 2 // lcdfill(0xaa); //显示竖条
570 2 // delay(10000);
571 2
572 2 // Frame(); //显示边框
573 2 /// delay(10000);
574 2
575 2 // gushi_display(); //显示古诗
576 2 // clrgdram();
577 2
578 2 // write_com(0x87); //调用自定义CGRAM代码
579 2 // write_data(0x00);
580 2 // write_data(0x00);
581 2 // delay(400);
582 2
583 2 // shuxian(); //加入两条竖线
584 2 // delay(8000);
585 2 // write_com(0x30);
586 2 // delay(1000);
587 2
588 2 // gushi_display();
589 2 // delay(6000);
590 2 for(i=0;i<8;i++) //字符左循环
591 2 {write_com(0x18);
592 3 delay(10000);}
593 2
594 2 // gushi_display();
595 2 // delay(6000);
596 2 // write_com(0x36);
597 2 // write_com(0x04); //第一行反白显示
598 2 // delay(20000);
599 2 // write_com(0x04); //第一行恢复显示
600 2 // delay(20000);
601 2 // write_com(0x05); //第二行反白显示
602 2 // delay(20000);
603 2 // write_com(0x05); //第二行恢复显示
604 2 // delay(20000);
605 2
606 2 // write_com(0x03); //垂直滚动屏幕
607 2 // write_com(0x60);
608 2 // delay(20000);
609 2
610 2 }
611 1 }
612
613
C51 COMPILER V8.06 TSET 09/08/2007 09:17:55 PAGE 11
614 /*
615 clrgdram();
616 clrscreen(); //??
617 Disp_Img(BMP); //??????
618 delay(10000);
619
620 lcdfill(0xff); //????
621 delay(20000);
622
623 Disp_H_Line(); //????
624 delay(20000);
625
626
627 lcdfill(0xaa); //????
628 delay(20000);
629
630 Frame(); //????
631 delay(20000);
632
633 gushi_display(); //????
634 clrgdram();
635
636 write_com(0x87); //??????CGRAM???
637 write_data(0x00);
638 write_data(0x00);
639 delay(400);
640
641 shuxian(); //??????
642 delay(8000);
643 write_com(0x30);
644 delay(1000);
645
646 gushi_display();
647 delay(6000);
648 for(i=0;i<8;i++) //??????
649 {write_com(0x18);
650 delay(20000);}
651
652 gushi_display();
653 delay(6000);
654 write_com(0x36);
655 write_com(0x04); //???????
656 delay(20000);
657 write_com(0x04); //???????
658 delay(20000);
659 write_com(0x05); //???????
660 delay(20000);
661 write_com(0x05); //???????
662 delay(20000);
663
664 write_com(0x03); //?????????
665 write_com(0x60);
666 delay(20000);
667 */
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 835 ----
CONSTANT SIZE = 2134 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 18
C51 COMPILER V8.06 TSET 09/08/2007 09:17:55 PAGE 12
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 + -