📄 led.lst
字号:
C51 COMPILER V8.15 LED 08/06/2009 13:49:09 PAGE 1
C51 COMPILER V8.15, COMPILATION OF MODULE LED
OBJECT MODULE PLACED IN LED.OBJ
COMPILER INVOKED BY: D:\专业软件SLF\keil\C51\BIN\C51.EXE LED.c BROWSE DEBUG OBJECTEXTEND
line level source
1 #include "reg52.h"
2
3 unsigned char code led_seg[13]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90,0xc6,0x89,0x8c};//C,H,P
-yingwen
4 unsigned char code led_seg1[10]={0x40,0x79,0x24,0x30,0x19,0x12,0x02,0x78,0x00,0x10};//有小数点
5 unsigned char code led_sel[8] = {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
6 unsigned char sel1,sel2,sel3,sel4,sel5,sel6,sel7,sel8;
7 static unsigned int j;
8
9 static void mDelay(j)
10 {
11 1 unsigned int i;
12 1 for(;j>0;j--)
13 1 {
14 2 for(i=124;i>0;i--)
15 2 {;}
16 2 }
17 1 }
18
19 void led_show(void)
20 {
21 1 P1=led_sel[0];
22 1 P0=led_seg[sel1];
23 1 mDelay(2);
24 1 P1=led_sel[1];
25 1 P0=led_seg[sel2];
26 1 mDelay(2);
27 1 P1=led_sel[2];
28 1 P0=led_seg1[sel3];//小数点显示
29 1 mDelay(2);
30 1 P1=led_sel[3];
31 1 P0=led_seg[sel4];
32 1 mDelay(2);
33 1 P1=led_sel[4];
34 1 P0=led_seg[sel5];
35 1 mDelay(2);
36 1 P1=led_sel[5];
37 1 P0=led_seg[sel6];
38 1 mDelay(2);
39 1 P1=led_sel[6];
40 1 P0=led_seg[sel7];
41 1 mDelay(2);
42 1 P1=led_sel[7];
43 1 P0=led_seg[sel8];
44 1 mDelay(2);
45 1 }
46
47 void led_show12(void)
48 {
49 1 P1=led_sel[0];
50 1 P0=led_seg[sel1];
51 1 mDelay(2);
52 1 P1=led_sel[1];
53 1 P0=led_seg[sel2];
54 1 mDelay(2);
C51 COMPILER V8.15 LED 08/06/2009 13:49:09 PAGE 2
55 1
56 1 }
57
58 void led_showdian(void)
59 {
60 1 P1=led_sel[0];
61 1 P0=led_seg[sel1];
62 1 mDelay(2);
63 1 P1=led_sel[1];
64 1 P0=led_seg1[sel2];//小数点显示
65 1 mDelay(2);
66 1 P1=led_sel[2];
67 1 P0=led_seg[sel3];
68 1 mDelay(2);
69 1 P1=led_sel[3];
70 1 P0=led_seg[sel4];
71 1 mDelay(2);
72 1 P1=led_sel[7];
73 1 P0=led_seg[sel8];
74 1 mDelay(2);
75 1 }
76
77 void led_show4(void)
78 {
79 1 P1=led_sel[0];
80 1 P0=led_seg[sel1];
81 1 mDelay(2);
82 1 P1=led_sel[1];
83 1 P0=led_seg[sel2];
84 1 mDelay(2);
85 1 P1=led_sel[2];
86 1 P0=led_seg[sel3];
87 1 mDelay(2);
88 1 P1=led_sel[3];
89 1 P0=led_seg1[sel4];
90 1 mDelay(2);
91 1 P1=led_sel[7];
92 1 P0=led_seg[sel8];
93 1 mDelay(2);
94 1 }
MODULE INFORMATION: STATIC OVERLAYABLE
CODE SIZE = 320 ----
CONSTANT SIZE = 31 ----
XDATA SIZE = ---- ----
PDATA SIZE = ---- ----
DATA SIZE = 10 ----
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 + -