文件名称:lesson6
介绍说明--下载内容均来自于网络,请自行研究使用
proteus单片机仿真-数码管(动态)
#include<reg51.H>
unsigned char code Tab[] {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}
unsigned char Dat[] {0,0,0,0}
unsigned char tmp,i,j
unsigned char s 0
void delay(int n)
{
int i
for(i 0 i<n i++)
}
void main()
{
while(1)
{
s++
if(s>500)
s 0
Dat[0] s/100
Dat[1] s 100/10
Dat[2] s 10
tmp 0x01
for(i 0 i<3 i++)
{
P2 tmp
P0 Tab[Dat[i]]
tmp tmp<<1
delay(250)
}
for(i 0 i<150 i++)
for(j 0 j<100 j++)
delay(60000)
}
}-Proteus single-chip microcomputer simulation- digital tube (dynamic)
# include < reg51. H >
Unsigned char code Tab [] {xa4 xc0 0, 0 xf9, 0, 0 xb0, 0 x99, 0 x92, 0 x82, 0 xf8, 0 x80, 0 x90}
Unsigned char Dat [] ,0,0,0 {0}
Unsigned char TMP, I, j
Unsigned char s 0
Void delay (int n)
{
Int I
For (I 0 I < n i++)
}
Void main ()
{
While (1)
{
S++
If (s > 500).
S 0
Dat [0] s/100
Dat [1] s 100/10
Dat [2] s 10
TMP 0 x01
For (I 0 I < 3 i++)
{
The P2 TMP
P0 Tab [Dat [I]]
TMP TMP < < 1
Delay (250)
}
For (I 0 I < 150 i++)
For (j 0 j < 100 j++)
Delay (60000)
}
}
#include<reg51.H>
unsigned char code Tab[] {0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90}
unsigned char Dat[] {0,0,0,0}
unsigned char tmp,i,j
unsigned char s 0
void delay(int n)
{
int i
for(i 0 i<n i++)
}
void main()
{
while(1)
{
s++
if(s>500)
s 0
Dat[0] s/100
Dat[1] s 100/10
Dat[2] s 10
tmp 0x01
for(i 0 i<3 i++)
{
P2 tmp
P0 Tab[Dat[i]]
tmp tmp<<1
delay(250)
}
for(i 0 i<150 i++)
for(j 0 j<100 j++)
delay(60000)
}
}-Proteus single-chip microcomputer simulation- digital tube (dynamic)
# include < reg51. H >
Unsigned char code Tab [] {xa4 xc0 0, 0 xf9, 0, 0 xb0, 0 x99, 0 x92, 0 x82, 0 xf8, 0 x80, 0 x90}
Unsigned char Dat [] ,0,0,0 {0}
Unsigned char TMP, I, j
Unsigned char s 0
Void delay (int n)
{
Int I
For (I 0 I < n i++)
}
Void main ()
{
While (1)
{
S++
If (s > 500).
S 0
Dat [0] s/100
Dat [1] s 100/10
Dat [2] s 10
TMP 0 x01
For (I 0 I < 3 i++)
{
The P2 TMP
P0 Tab [Dat [I]]
TMP TMP < < 1
Delay (250)
}
For (I 0 I < 150 i++)
For (j 0 j < 100 j++)
Delay (60000)
}
}
(系统自动生成,下载前可以参看下载内容)
下载文件列表
lesson6
.......\lesson6.SEC
.......\lesson6_1
.......\lesson6_1.c
.......\lesson6_1.dsn
.......\lesson6_1.hex
.......\lesson6_1.lnp
.......\lesson6_1.LST
.......\lesson6_1.M51
.......\lesson6_1.OBJ
.......\lesson6_1.plg
.......\lesson6_1.PWI
.......\lesson6_1.uvopt
.......\lesson6_1.uvproj
.......\lesson6_1_uvproj.bak
.......\lesson6_2
.......\lesson6_2.c
.......\lesson6_2.dsn
.......\lesson6_2.hex
.......\lesson6_2.lnp
.......\lesson6_2.LST
.......\lesson6_2.M51
.......\lesson6_2.OBJ
.......\lesson6_2.plg
.......\lesson6_2.PWI
.......\lesson6_2.uvopt
.......\lesson6_2.uvproj
.......\lesson6_2_uvproj.bak
.......\lesson6_3
.......\lesson6_3.c
.......\lesson6_3.dsn
.......\lesson6_3.hex
.......\lesson6_3.lnp
.......\lesson6_3.LST
.......\lesson6_3.M51
.......\lesson6_3.OBJ
.......\lesson6_3.plg
.......\lesson6_3.PWI
.......\lesson6_3.uvopt
.......\lesson6_3.uvproj
.......\lesson6_3_uvopt.bak
.......\lesson6_3_uvproj.bak