📄 22.lst
字号:
429 3 {
430 4 peak_data=1;
431 4 LCD_write_picture();
432 4 }
433 3
434 3 LCD_write_instruction(0x97);
435 3 break;
436 3 case 5:if(frequency_data==1)
437 3 {
438 4 frequency_data=3;
439 4 LCD_write_picture();
440 4 }
441 3 else if(frequency_data==2)
442 3 {
443 4 frequency_data=1;
444 4 LCD_write_picture();
445 4 }
446 3 else if(frequency_data==3)
447 3 {
448 4 frequency_data=2;
449 4 LCD_write_picture();
450 4 }
451 3
452 3 LCD_write_instruction(0x8F);
453 3 break;
454 3 default:break;
455 3 }
456 2 break;
457 2 case 15:switch(trace)
458 2 {
459 3 case 1:trace=2;LCD_write_picture();LCD_write_instruction(0x96);break;
460 3 case 2:trace=3;LCD_write_picture();LCD_write_instruction(0x97);break;
461 3 case 3:trace=4;LCD_write_picture();LCD_write_instruction(0x8E);break;
462 3 case 4:trace=5;LCD_write_picture();LCD_write_instruction(0x8F);break;
463 3 case 5:trace=1;LCD_write_picture();LCD_write_instruction(0x87);break;
464 3 default:break;
465 3 }
466 2 numbit=0;
467 2 break;
468 2 case 16:switch(trace)
469 2 {
470 3 case 1:switch(picture_data)
471 3 {
472 4 case 1:
473 4 picture_data=2;
474 4 LCD_write_picture();
475 4 break;
476 4 case 2:
477 4 picture_data=3;
478 4 LCD_write_picture();
479 4 break;
480 4 case 3:
481 4 picture_data=1;
482 4 LCD_write_picture();
C51 COMPILER V8.02 22 07/18/2007 12:34:07 PAGE 9
483 4 break;
484 4 default:break;
485 4 }
486 3 LCD_write_instruction(0x87);
487 3 trace=1;
488 3 break;
489 3 case 3:if(peak_data==1)
490 3 {
491 4 peak_data=2;
492 4 LCD_write_picture();
493 4 }
494 3 else
495 3 {
496 4 peak_data=1;
497 4 LCD_write_picture();
498 4 }
499 3 trace=3;
500 3 LCD_write_instruction(0x97);
501 3 break;
502 3 case 5:if(frequency_data==1)
503 3 {
504 4 frequency_data=2;
505 4 LCD_write_picture();
506 4 }
507 3 else if(frequency_data==2)
508 3 {
509 4 frequency_data=3;
510 4 LCD_write_picture();
511 4 }
512 3 else if(frequency_data==3)
513 3 {
514 4 frequency_data=1;
515 4 LCD_write_picture();
516 4 }
517 3 trace=5;
518 3 LCD_write_instruction(0x8F);
519 3 break;
520 3 default:break;
521 3 }
522 2 break;
523 2 }
524 1
525 1 }
526
527
528 void LCD_write_picture(void) //绘图子程序
529 {
530 1 int k;
531 1 LCD_write_instruction(0x01);
532 1 delay_155us();
533 1 LCD_write_instruction(0x34);
534 1 delay_155us();
535 1 LCD_write_instruction(0x36);
536 1 delay_155us();
537 1 switch(picture_data)
538 1 {
539 2 case 1:ip1=picture1;break;
540 2 case 2:ip1=picture2;break;
541 2 case 3:ip1=picture3;break;
542 2 default:break;
543 2 }
544 1 switch(peak_data)
C51 COMPILER V8.02 22 07/18/2007 12:34:07 PAGE 10
545 1 {
546 2 case 1:ip2=unit6;ip3=unit5;break;
547 2 case 2:ip2=unit5;ip3=blank;break;
548 2 default:break;
549 2 }
550 1 switch(frequency_data)
551 1 {
552 2 case 1:ip4=blank;break;
553 2 case 2:ip4=unit1;break;
554 2 case 3:ip4=unit4;break;
555 2 default:break;
556 2 }
557 1
558 1 for(i=0;i<16;i++) //第一行图形
559 1 {
560 2 LCD_write_instruction(0x80+i); //显示地址
561 2 LCD_write_instruction(0x80); //显示X地址
562 2 for(j=0;j<16;j++)
563 2 {
564 3 LCD_write_data(*ip1);
565 3 ++ip1;
566 3 }
567 2 }
568 1 delay_155us();
569 1 k=0;
570 1 for(i=0;i<16;i++) //第二行图形
571 1 {
572 2 LCD_write_instruction(0x80+16+i); //显示地址
573 2 LCD_write_instruction(0x80); //显示X地址
574 2 for(j=0;j<8;j++)
575 2 LCD_write_data(peak[j+k*8]);
576 2
577 2 for(j=0;j<5;j++)
578 2 LCD_write_data(peak_digit[5-j-1][k]);
579 2
580 2 ++k;
581 2
582 2 LCD_write_data(0x00);
583 2 LCD_write_data(*ip2);
584 2 LCD_write_data(*ip3);
585 2 ++ip2;
586 2 ++ip3;
587 2 }
588 1 delay_155us();
589 1 k=0;
590 1 for(i=0;i<16;i++) //第三行图形
591 1 {
592 2 LCD_write_instruction(0x80+i); //显示地址
593 2 LCD_write_instruction(0x88); //显示X地址
594 2 for(j=0;j<8;j++)
595 2 {
596 3 LCD_write_data(frequency[j+k*8]);
597 3 }
598 2 for(j=0;j<5;j++)
599 2 LCD_write_data(frequency_digit[5-j-1][k]);
600 2 ++k;
601 2
602 2 LCD_write_data(*ip4);
603 2 LCD_write_data(unit2[i]);
604 2 LCD_write_data(unit3[i]);
605 2 ++ip4;
606 2 }
C51 COMPILER V8.02 22 07/18/2007 12:34:07 PAGE 11
607 1 delay_155us();
608 1 for(i=0;i<16;i++) //第四行图形
609 1 {
610 2 LCD_write_instruction(0x80+16+i); //显示地址
611 2 LCD_write_instruction(0x88); //显示X地址
612 2 for(j=0;j<16;j++)
613 2 LCD_write_data(blank[j]);
614 2 }
615 1 }
616
617
618 /* 主函数 */
619 void main(void)
620 {
621 1 LCD_initial();
622 1 picture_data=2;
623 1 peak_data=2;
624 1 frequency_data=2;
625 1
626 1 LCD_write_picture();
627 1 LCD_write_instruction(0x96); //显示地址
628 1 trace=2;
629 1 while(1)
630 1 {
631 2 keyscan( );
632 2 }
633 1
634 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 2150 ----
CONSTANT SIZE = 1312 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 28 6
IDATA SIZE = 160 ----
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 + -