1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
#include <STC15F2K60S2.H>
#include "show.h"
u8 data_adc[] = {
0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x90, 0xff
};
void Delay1ms() //@12.000MHz
{
unsigned char i, j;
i = 12;
j = 169;
do
{
while (--j);
} while (--i);
}
void show(u8 yi, u8 er, u8 san, u8 si, u8 wu, u8 liu, u8 qi, u8 ba){
P2 = 0xc0;
P0 = 0x01;
P2 = 0xe0;
P0 = yi;
Delay1ms();
P2 = 0xc0;
P0 = 0x02;
P2 = 0xe0;
P0 = er;
Delay1ms();
P2 = 0xc0;
P0 = 0x04;
P2 = 0xe0;
P0 = san;
Delay1ms();
P2 = 0xc0;
P0 = 0x08;
P2 = 0xe0;
P0 = si;
Delay1ms();
P2 = 0xc0;
P0 = 0x10;
P2 = 0xe0;
P0 = wu;
Delay1ms();
P2 = 0xc0;
P0 = 0x20;
P2 = 0xe0;
P0 = liu;
Delay1ms();
P2 = 0xc0;
P0 = 0x40;
P2 = 0xe0;
P0 = qi;
Delay1ms();
P2 = 0xc0;
P0 = 0x80;
P2 = 0xe0;
P0 = ba;
Delay1ms();
P2 = 0x00;
}
|