📄 cgm12864b.lst
字号:
568 1 temp_y |= 0x80;
569 1
570 1 for(i=0;i<32;i++ ) //上半屏32行
571 1 {
572 2 LCD_WriteCommand(temp_y++); //设置绘图区的Y地址坐标0
573 2 LCD_WriteCommand(temp_x); //设置绘图区的X地址坐标0
574 2 for(j=0;j<16;j++)
575 2 {
576 3 LCD_WriteData(*Draw++);
577 3 }
578 2 }
579 1
580 1 temp_x = 0x88;
581 1 temp_y = 0x80;
582 1 for(;i<64;i++ )
583 1 {
584 2 LCD_WriteCommand(temp_y++); //设置绘图区的Y地址坐标
585 2 LCD_WriteCommand(temp_x); //设置绘图区的X地址坐标
586 2 for(j=0;j<16;j++)
587 2 {
588 3 LCD_WriteData(*Draw++);
589 3 }
590 2 }
591 1 }
592 void Write0(uchar x, uchar y) //绘图区清零
593 {
594 1 uchar i, j, temp_x, temp_y;
595 1 temp_x = x;
596 1 temp_y = y;
597 1 temp_x |= 0x80;
598 1 temp_y |= 0x80;
599 1 for(i=0;i<32;i++ ) //上半屏32行
600 1 {
601 2 LCD_WriteCommand(temp_y++); //设置绘图区的Y地址坐标0
602 2 LCD_WriteCommand(temp_x); //设置绘图区的X地址坐标0
603 2 for(j=0;j<16;j++)
604 2 {
605 3 LCD_WriteData(0x00); //写00清除绘图区
606 3 }
607 2 }
608 1 temp_x = 0x88;
609 1 temp_y = 0x80;
610 1 for(;i<64;i++ )
611 1 {
612 2 LCD_WriteCommand(temp_y++); //设置绘图区的Y地址坐标
613 2 LCD_WriteCommand(temp_x); //设置绘图区的X地址坐标
C51 COMPILER V8.02 CGM12864B 05/07/2009 22:41:02 PAGE 11
614 2 for(j=0;j<16;j++)
615 2 {
616 3 LCD_WriteData(0x00);
617 3 }
618 2 }
619 1 }
620 void draw_cicle(uchar *p,uchar k) //绘曲线
621 {
622 1 uchar n,j,Y,X;
623 1 uint a=0x8000;
624 1
625 1 for(n=0;n<256;n++)
626 1 {
627 2 Y=0x80+0x1f-p[k*n+1]/8;
628 2 if((n+1)%16==0)
629 2 j++;
630 2 if(j>=8)
631 2 j=0;
632 2 X=0x80|j;
633 2 LCD_WriteCommand(Y);
634 2 LCD_WriteCommand(X);
635 2 delay(10);
636 2 LCD_WriteData2(a);
637 2 a>>=1;
638 2 if(a==0)
639 2 a=0x8000;
640 2 LCD_WriteCommand(0x36);
641 2 if(k*n>=255)
642 2 break;
643 2 }
644 1 }
645
646
647 void main (void)
648 {
649 1 // uchar i=1,key;
650 1 // WDTCN = 0xde;
651 1 // WDTCN = 0xad; //关看门狗
652 1 // SYSCLK_Init (); //初始化时钟
653 1 // PORT_Init (); //初始化IO口
654 1 SysInit();
655 1 EA=1; //开中断
656 1 InitLCD(); //清屏
657 1 delay(100); //延时1S
658 1 SetDraw();
659 1 // LCD_WriteCommand(0x80);
660 1 // LCD_WriteCommand(0x80);
661 1 delay(100);
662 1 Write0(0,0);
663 1 /* while(1)
664 1 {
665 1 key=KeyScan();
666 1 if(key==1)
667 1 {
668 1 i++;
669 1 Write0(0,0);
670 1 }
671 1 draw_cicle(sin_table,i);
672 1 } */
673 1 //LCD_WriteCommand(0x36);
674 1 Draw_Pic(0,0,*gImage_123);
675 1 LCD_WriteCommand(0x36);
C51 COMPILER V8.02 CGM12864B 05/07/2009 22:41:02 PAGE 12
676 1 /* LCD_WriteCommand(0x30);
677 1 for(i=0;i<15;i++)
678 1 LCD_WriteCommand(0x06);
679 1 delay(10); 未通 */
680 1 // while(1);
681 1 // {
682 1 /* LCD_WriteCommand(0x80);
683 1 LCD_WriteData(0xb8);
684 1 LCD_WriteData(0xdf);
685 1 LCD_WriteCommand(0x90);
686 1 LCD_WriteData(0xba);
687 1 LCD_WriteData(0xba);
688 1 delay(10);
689 1 LCD_WriteCommand(0x88);
690 1 LCD_WriteData(0xb2);
691 1 LCD_WriteData(0xc5);
692 1 delay(10);
693 1 LCD_WriteCommand(0x98);
694 1 LCD_WriteData(0xb2);
695 1 LCD_WriteData(0xc5);*/
696 1 // LCD_WriteCommand(0x34);
697 1 // LCD_WriteCommand(0x30);
698 1 /* for(i=0;i<16;i++)
699 1 LCD_WriteCommand(0x07);
700 1 LCD_WriteCommand(0x34);
701 1 LCD_WriteCommand(0x36); */
702 1 // LCD_WriteCommand(0x01);
703 1 // Char_Set_XY(0,0, "集成运放测试仪示波器输出信号该程");
704 1 // Char_Set_XY(0,1, "高汉才先生,你好吗!");
705 1 // Char_Set_XY(0,3, "皮肤之魔兽主题");
706 1 /* for(i=0;;i++)
707 1 {
708 1 LCD_WriteCommand(0x30);
709 1 delay(100);
710 1 LCD_WriteCommand(0x07);
711 1 delay(100);
712 1 }*/
713 1 /* LCD_WriteCommand(0x34);
714 1 LCD_WriteCommand(0x05);
715 1 LCD_WriteCommand(0x30);
716 1 LCD_WriteCommand(0x01);
717 1 LCD_WriteCommand(0x34);
718 1 LCD_WriteCommand(0x36); */
719 1 /*Char_Set_XY(1,1, "欢迎您使用!");
720 1 Char_Set_XY(0,2, "制作人:");
721 1 Char_Set_XY(4,3, "高汉才"); */
722 1 /* delay(50);
723 1 WriteCGRAM(gao,0x40);
724 1 WriteCGRAM(gao,0x50);
725 1 WriteCGRAM(gao,0x60);
726 1 WriteCGRAM(gao,0x70);
727 1 ReadCGRAM(0x80,0x00);
728 1 ReadCGRAM(0x81,0x02);
729 1 ReadCGRAM(0x82,0x04);
730 1 ReadCGRAM(0x83,0x06); */
731 1 /* LCD_WriteCommand(0x34|0x02);
732 1 LCD_WriteCommand(0x36);
733 1 // LCD_WriteCommand(0x30);
734 1 LCD_WriteCommand(0x01);
735 1
736 1 for(i=0;i<16;i++)
737 1 {
C51 COMPILER V8.02 CGM12864B 05/07/2009 22:41:02 PAGE 13
738 1 LCD_WriteCommand(0x80+i);
739 1 LCD_WriteCommand(0x80);
740 1 LCD_WriteData(gao[i]);
741 1 } */
742 1 // displaybmp(screen1);
743 1 // }
744 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 619 ----
CONSTANT SIZE = 1024 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = ---- 21
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 + -