視頻鏈接:https://www.bilibili.com/video/BV1Hv4y1f7Uq
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar ROG[64];
uchar ROG_buff[64];
uchar l_num=0;
uchar w_num;
int time;
bit flag;
uchar play_mode;
uchar stay_flag;
uchar hang[]=
{
0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,
0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,0x00,
};
uchar code lie[]=
{
0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0x00,0x01,0xFE,0xFF,0xFE,0xFF,
0xFD,0x7F,0xFD,0x7F,0xFB,0xBF,0xFB,0xBF,0xF7,0xDF,0xEF,0xEF,0xDF,0xF7,0x3F,0xF9,/*"大",0*/
0xFD,0xFF,0xFE,0xFF,0x80,0x01,0xBF,0xFD,0x7F,0xFB,0x80,0x03,0xFD,0xFF,0xF2,0xF7,
0x8E,0x6F,0xFD,0x5F,0xF3,0x3F,0x8E,0x5F,0xF9,0x67,0xE7,0x79,0x1D,0x7F,0xFE,0xFF,/*"家",1*/
0xEF,0xFF,0xEF,0x03,0xEF,0xFB,0xEF,0xF7,0x03,0xEF,0xDB,0xDF,0xDB,0xDF,0xDA,0x01,
0xDB,0xDF,0xB7,0xDF,0xD7,0xDF,0xEF,0xDF,0xD7,0xDF,0xBB,0xDF,0x7B,0x5F,0xFF,0xBF,/*"好",2*/
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,
0xFF,0xFF,0xFF,0xFF,0xFF,0xFF,0xCF,0xFF,0xCF,0xFF,0xEF,0xFF,0xDF,0xFF,0xFF,0xFF,/*",",3*/
0xFB,0xBF,0xF1,0xAF,0x87,0xB7,0xF7,0xB7,0xF7,0xBF,0x00,0x01,0xF7,0xBF,0xF7,0xBB,
0xF5,0xBB,0xF3,0xB7,0xE7,0xCF,0x97,0xDD,0xF7,0xAD,0xF7,0x75,0xD4,0xF9,0xEF,0xFD,/*"我",4*/
0xE0,0x0F,0xEF,0xEF,0xEF,0xEF,0xE0,0x0F,0xEF,0xEF,0xEF,0xEF,0xE0,0x0F,0xFF,0xFF,
0x00,0x01,0xFE,0xFF,0xEE,0xFF,0xEE,0x07,0xEE,0xFF,0xD6,0xFF,0xBA,0xFF,0x7C,0x01,/*"是",5*/
0xF7,0xFF,0xE2,0x03,0x0E,0xFB,0xEE,0xFB,0xEE,0xFB,0x02,0x03,0xEF,0xFF,0xCF,0xFF,
0xC6,0x01,0xAB,0xDF,0xAB,0xDF,0x6E,0x03,0xEF,0xDF,0xEF,0xDF,0xEC,0x01,0xEF,0xFF,/*"程",6*/
0xEF,0xBF,0xEF,0xDF,0xDC,0x01,0x85,0xFD,0xB3,0xFB,0xB6,0x07,0xB7,0xFF,0xB7,0xFF,
0x84,0x01,0xB7,0x6F,0xB7,0x6F,0xB7,0x6F,0xB6,0xED,0x86,0xED,0xB5,0xF1,0xFB,0xFF,/*"皖",7*/
};
sbit sh0=P1^0;
sbit ds0=P1^1;
sbit st0=P1^2;
sbit sh1=P1^3;
sbit ds1=P1^4;
sbit st1=P1^5;
uchar i;
void delay(uchar z)
{
for(z;z>0;z--)
for(i=110;i>0;i--);
}
void send0(uchar temp0)
{
for(i=0;i8;i++)
{
sh0=0;
ds0=temp0&0x80;
temp0=temp0<1;
sh0=1;
}
}
void send1(uchar temp1)
{
for(i=0;i8;i++)
{
sh1=0;
ds1=temp1&0x80;
temp1=temp1<1;
sh1=1;
}
}
void Send_All(int A1,int A2,int B1,int B2)
{
send0(A1);
send1(B1);
st0=0;
st1=0;
st0=1;
st1=1;
send0(A2);
send1(B2);
st0=0;
st1=0;
st0=1;
st1=1;
}
void Show_One(uchar num)
{
uchar i=0,j,n;
for(j=0;j32;j++)
{
send0(hang[j]);
send1(lie[num*32+j]);
n++;
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
}
}
void Show_SX(uchar num)
{
uchar i=0,j,n;
int m,anw;
if(num==1){anw = 16;}
else{anw = num * 32;}
for(j=0;j32;j++)
{
send0(hang[j]);
send1(lie[j+m]);
n++;
while(stay_flag);
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
delay(1);
}
delay(1);
m+=2;
if(m==anw)m=0;
}
void Show_ZY(uchar num)
{
uchar i=0,j,n;
for(j=0;j32;j++)
{
send0(hang[j]);
send1(lie[num*32+j]);
n++;
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
}
}
void Show_data()
{
uchar i=0,j,n;
for(j=0;j32;j++)
{
send0(hang[j]);
send1(ROG[j]);
n++;
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
}
}
void Control(uchar num)
{
uchar i,j,m;
num = num*2;
time ++;
if(time == 5)
{
time = 0;
if(j==7)
{
j = 0;
if(l_num(8-j);
ROG[2*i+1] = ROG_buff[2*i+1]>(8-j);
}
}
while(stay_flag);
Show_data();
}
void main()
{
uchar m;
for(m=0;m64;m++)
{
ROG_buff[m] = 0xff;
}
while(1)
{
//Show_One(3);
// Control(7);
Show_SX(7);
}
}
#include
#include
#define uchar unsigned char
#define uint unsigned int
uchar ROG[64];
uchar ROG_buff[64];
uchar l_num=0;
uchar w_num;
int time;
bit flag;
uchar play_mode;
uchar stay_flag;
uchar hang[]=
{
0x00,0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,
0x01,0x00,0x02,0x00,0x04,0x00,0x08,0x00,0x10,0x00,0x20,0x00,0x40,0x00,0x80,0x00,
};
uchar code lie[]=
{
0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0xFE,0xFF,0x00,0x01,0xFE,0xFF,0xFE,0xFF,
0xFD,0x7F,0xFD,0x7F,0xFB,0xBF,0x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0xEC,0x01,0xEF,0xFF,/*"程",6*/
0xEF,0xBF,0xEF,0xDF,0xDC,0x01,0x85,0xFD,0xB3,0xFB,0xB6,0x07,0xB7,0xFF,0xB7,0xFF,
0x84,0x01,0xB7,0x6F,0xB7,0x6F,0xB7,0x6F,0xB6,0xED,0x86,0xED,0xB5,0xF1,0xFB,0xFF,/*"皖",7*/
};
sbit sh0=P1^0;
sbit ds0=P1^1;
sbit st0=P1^2;
sbit sh1=P1^3;
sbit ds1=P1^4;
sbit st1=P1^5;
uchar i;
void delay(uchar z)
{
for(z;z>0;z--)
for(i=110;i>0;i--);
}
void send0(uchar temp0)
{
for(i=0;i8;i++)
{
sh0=0;
ds0=temp0&0x80;
temp0=temp0<1;
sh0=1;
}
}
void send1(uchar temp1)
{
for(i=0;i8;i++)
{
sh1=0;
ds1=temp1&0x80;
temp1=temp1<1;
sh1=1;
}
}
void Send_All(int A1,int A2,int B1,int B2)
{
send0(A1);
send1(B1);
st0=0;
st1=0;
st0=1;
st1=1;
send0(A2);
send1(B2);
st0=0;
st1=0;
st0=1;
st1=1;
}
void Show_One(uchar num)
{
uchar i=0,j,n;
for(j=0;j32;j++)
{
send0(hang[j]);
send1(lie[num*32+j]);
n++;
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
}
}
void Show_SX(uchar num)
{
uchar i=0,j,n;
int m,anw;
if(num==1){anw = 16;}
else{anw = num * 32;}
for(j=0;j32;j++)
{
send0(hang[j]);
send1(lie[j+m]);
n++;
while(stay_flag);
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
delay(1);
}
delay(1);
m+=2;
if(m==anw)m=0;
}
void Show_ZY(uchar num)
{
uchar i=0,j,n;
for(j=0;j32;j++)
{
send0(hang[j]);
send1(lie[num*32+j]);
n++;
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
}
}
void Show_data()
{
uchar i=0,j,n;
for(j=0;j32;j++)
{
send0(hang[j]);
send1(ROG[j]);
n++;
if(n==2)
{
st0=0;
st1=0;
st0=1;
st1=1;
n=0;
}
}
}
void Control(uchar num)
{
uchar i,j,m;
num = num*2;
time ++;
if(time == 5)
{
time = 0;
if(j==7)
{
j = 0;
if(l_num(8-j);
ROG[2*i+1] = ROG_buff[2*i+1]>(8-j);
}
}
while(stay_flag);
Show_data();
}
void main()
{
uchar m;
for(m=0;m64;m++)
{
ROG_buff[m] = 0xff;
}
while(1)
{
//Show_One(3);
// Control(7);
Show_SX(7);
}
}
審核編輯:湯梓紅
聲明:本文內容及配圖由入駐作者撰寫或者入駐合作網站授權轉載。文章觀點僅代表作者本人,不代表電子發燒友網立場。文章及其配圖僅供工程師學習之用,如有內容侵權或者其他違規問題,請聯系本站處理。
舉報投訴
-
嵌入式
+關注
關注
5068文章
19014瀏覽量
303228 -
Proteus
+關注
關注
79文章
1692瀏覽量
106371 -
點陣
+關注
關注
6文章
194瀏覽量
72470 -
點陣顯示
+關注
關注
0文章
18瀏覽量
8316
發布評論請先 登錄
相關推薦
Proteus 8 Professional制作16x16點陣屏詳細教程
自己制作了個Proteus 8 Professional制作16x16點陣屏詳細教程,也許對大家有用O(∩_∩)O!
發表于 11-30 19:52
使用8255芯片和74LS154設計的16X16點陣屏的仿真電路圖免費下載
本文檔的主要內容詳細介紹的是使用8255芯片和74LS154設計的16X16點陣屏的仿真電路圖免費下載。
發表于 12-30 17:48
?22次下載
16X16點陣編寫技巧的思路
來說一下16X16點陣的編寫技巧,主要講一下思路,因為在寫16X16點陣驅動時,很多人一上來大腦一片空白啊,根本無從下手,我這里舉一個例子講下思路,以后大家可以按照我下面的思路來寫程序
評論