標(biāo)題:
16*16點(diǎn)陣顯示你好的仿真和單片機(jī)源碼,學(xué)校簡(jiǎn)單課設(shè)
[打印本頁]
作者:
哈嘻
時(shí)間:
2018-7-19 14:14
標(biāo)題:
16*16點(diǎn)陣顯示你好的仿真和單片機(jī)源碼,學(xué)校簡(jiǎn)單課設(shè)
附件是基于單片機(jī)的點(diǎn)陣,很簡(jiǎn)單,需要可直接下載
仿真原理圖如下(proteus仿真工程文件可到本帖附件中下載)
0.png
(16.33 KB, 下載次數(shù): 82)
下載附件
2018-7-19 16:43 上傳
單片機(jī)源程序如下:
#include<reg52.h>
#define uchar unsigned char
#define uint unsigned int
uchar code col[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
uchar code row[][32]={
{0x80, 0x00,
0x40, 0x00,
0xf0, 0x7f,
0x2c, 0x00,
0x43, 0x10,
0x20, 0x0c,
0x98, 0x03,
0x0f, 0x21,
0x0a, 0x40,
0xe8, 0x3f,
0x08, 0x00,
0x88, 0x00,
0x28, 0x03,
0x1c, 0x1c,
0x08, 0x08,
0x00, 0x00 }, //顯示字碼:你
{0x10, 0x80,
0x10, 0x43,
0xf0, 0x22,
0x1f, 0x14,
0x10, 0x0c,
0xf0, 0x73,
0x80, 0x20,
0x82, 0x00,
0x82, 0x40,
0x82, 0x80,
0xf2, 0x7f,
0x8a, 0x00,
0x86, 0x00,
0x82, 0x00,
0x80, 0x00,
0x00, 0x00} //顯示字碼:好
};
void delayms(uint t) //每1延時(shí)1ms
{
uint x,y;
for(x=t;x>0;x--)
for(y=124;y>0;y--);
}
void display(uint n) //n為顯示字碼的序數(shù)
{
uint i,j;
for(j=0;j<10;j++)
for(i=0;i<16;i++)
{
if(i<8) P2=col[i],P3=0xff;
else P2=0xff, P3=col[i-8];
P0=row[n][2*i];
P1=row[n][2*i+1];
delayms(3);
}
}
void main()
{
while(1)
{
display(0);
delayms(50);
display(1);
delayms(50);
}
}
復(fù)制代碼
所有資料51hei提供下載:
4(1).rar
(46 KB, 下載次數(shù): 18)
2018-7-19 14:12 上傳
點(diǎn)擊文件名下載附件
點(diǎn)陣
下載積分: 黑幣 -5
歡迎光臨 (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1