RT
物流太不给力了,广东到青岛差不多要了6天,淘宝发货又不及时,耽误了好几天,昨天元件终于到了,连夜焊接好+简单测试。手机画质太渣了,还得借个相机上图。。
真不知道做啥好,还是想到啥做啥吧,下面将回帖慢慢更新最新的进程。
共8条
1/1 1 跳转至页
点阵显示程序 其实很简单 跟数码管动态显示一个道理
[hid']
#include <reg52.h>
#define uchar unsigned char
#define u8 unsigned int
uchar code tab[8]= {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 } ; //P0口 行控制
uchar code num_tab[26][8]={
/*--8*8--阴码--逐行扫描--逆向(低位在前)--*/
{0x00,0xE7,0xDB,0xDB,0xDB,0xC3,0xDB,0xDB},/*"A",0*/
{0x00,0xE3,0xDB,0xDB,0xE3,0xDB,0xDB,0xE3},/*"B",1*/
{0x00,0xE7,0xDB,0xFB,0xFB,0xFB,0xDB,0xE7},/*"C",2*/
{0x00,0xE3,0xDB,0xDB,0xDB,0xDB,0xDB,0xE3},/*"D",3*/
{0x00,0xC3,0xFB,0xFB,0xE3,0xFB,0xFB,0xC3},/*"E",4*/
{0x00,0xC3,0xFB,0xFB,0xE3,0xFB,0xFB,0xFB},/*"F",5*/
{0x00,0xE7,0xDB,0xFB,0xCB,0xDB,0xDB,0xE7},/*"G",6*/
{0x00,0xDB,0xDB,0xDB,0xC3,0xDB,0xDB,0xDB},/*"H",7*/
{0x00,0xE3,0xF7,0xF7,0xF7,0xF7,0xF7,0xE3},/*"I",8*/
{0x00,0xDF,0xDF,0xDF,0xDF,0xDB,0xDB,0xE7},/*"J",9*/
{0x00,0xDB,0xDB,0xEB,0xF3,0xEB,0xDB,0xDB}, /*"K",10*/
{0x00,0xFB,0xFB,0xFB,0xFB,0xFB,0xFB,0xC3},/*"L",11*/
{0x00,0xDB,0xC3,0xC3,0xDB,0xDB,0xDB,0xDB},/*"M",12*/
{0x00,0xDB,0xD3,0xD3,0xCB,0xCB,0xDB,0xDB},/*"N",13*/
{0x00,0xC3,0xDB,0xDB,0xDB,0xDB,0xDB,0xC3},/*"O",14*/
{0x00,0xE3,0xDB,0xDB,0xE3,0xFB,0xFB,0xFB},/*"P",15*/
{0x00,0xE7,0xDB,0xDB,0xDB,0xD3,0xCB,0xC7},/*"Q",16*/
{0x00,0xE3,0xDB,0xDB,0xE3,0xF3,0xEB,0xDB},/*"R",17*/
{0x00,0xE7,0xDB,0xFB,0xE7,0xDF,0xDB,0xE7},/*"S",18*/
{0x00,0xC1,0xF7,0xF7,0xF7,0xF7,0xF7,0xF7},/*"T",19*/
{0x00,0xDB,0xDB,0xDB,0xDB,0xDB,0xDB,0xE7},/*"U",20*/
{0x00,0xDB,0xDB,0xDB,0xDB,0xE7,0xE7,0xE7}, /*"V",21*/
{0x00,0xDB,0xDB,0xDB,0xDB,0xC3,0xC3,0xDB},/*"W",22*/
{0x00,0xDB,0xDB,0xE7,0xE7,0xE7,0xDB,0xDB},/*"X",23*/
{0x00,0xDD,0xDD,0xEB,0xF7,0xF7,0xF7,0xF7},/*"Y",24*/
{0x00,0xC3,0xDF,0xEF,0xE7,0xF7,0xFB,0xC3},/*"Z",25*/
}; //P2口控制 0亮 1不亮
void Delay(int Ms)// 12M晶振 大概延时1Ms
{
u8 x,y;
for(x=Ms;x>0;x--)
for(y=115;y>0;y--);
}
void main(void)
{
u8 i,j,k;
while(1)
{
for(j=0;j<26;j++) //显示A-Z
{
Delay(10) ;
k=0;
while(k<120)
{
for(i=0;i<8;i++)
{
Delay(10);
P0=tab[i];
P2=num_tab[j][i];
}
k++;
}
}
for(j=24;j>0;j--) //显示Y-B
{
Delay(10) ;
k=0;
while(k<120)
{
for(i=0;i<8;i++)
{
Delay(10);
P0=tab[i];
P2=num_tab[j][i];
}
k++;
}
}
}
}
['/hid]
[hid']
#include <reg52.h>
#define uchar unsigned char
#define u8 unsigned int
uchar code tab[8]= {0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80 } ; //P0口 行控制
uchar code num_tab[26][8]={
/*--8*8--阴码--逐行扫描--逆向(低位在前)--*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/*"U",20*/
{0x00,0xDB,0xDB,0xDB,0xDB,0xE7,0xE7,0xE7}, /*"V",21*/
{0x00,0xDB,0xDB,0xDB,0xDB,0xC3,0xC3,0xDB},/*"W",22*/
{0x00,0xDB,0xDB,0xE7,0xE7,0xE7,0xDB,0xDB},/*"X",23*/
{0x00,0xDD,0xDD,0xEB,0xF7,0xF7,0xF7,0xF7},/*"Y",24*/
{0x00,0xC3,0xDF,0xEF,0xE7,0xF7,0xFB,0xC3},/*"Z",25*/
}; //P2口控制 0亮 1不亮
void Delay(int Ms)// 12M晶振 大概延时1Ms
{
u8 x,y;
for(x=Ms;x>0;x--)
for(y=115;y>0;y--);
}
void main(void)
{
u8 i,j,k;
while(1)
{
for(j=0;j<26;j++) //显示A-Z
{
Delay(10) ;
k=0;
while(k<120)
{
for(i=0;i<8;i++)
{
Delay(10);
P0=tab[i];
P2=num_tab[j][i];
}
k++;
}
}
for(j=24;j>0;j--) //显示Y-B
{
Delay(10) ;
k=0;
while(k<120)
{
for(i=0;i<8;i++)
{
Delay(10);
P0=tab[i];
P2=num_tab[j][i];
}
k++;
}
}
}
}
['/hid]
共8条
1/1 1 跳转至页
回复
有奖活动 | |
---|---|
【有奖活动】分享技术经验,兑换京东卡 | |
话不多说,快进群! | |
请大声喊出:我要开发板! | |
【有奖活动】EEPW网站征稿正在进行时,欢迎踊跃投稿啦 | |
奖!发布技术笔记,技术评测贴换取您心仪的礼品 | |
打赏了!打赏了!打赏了! |