哇哈哈哈,终于搞定点阵屏了!
点阵大小:32X8
行线驱动:74ls138
列线驱动:74hc595 X4
主控:stc89c52
今天下班回来,实在想的没招了,只好用万用表好好测试,结果发现,元件里混进了2个劣质三极管,就是这俩玩意搞的我两天没睡好觉啊,真是TMD混帐!
换了新的后终于正常了,效果给大家看看,哈哈
不错,嘿嘿,电子真心很好玩啊
很想要资料。
还不错哦!
小编,江湖救急啊 ! 我的邮箱,519828247@qq.com
6*16点阵,现象是字移动到一半的点阵就消失了,到另一半点阵又出现了,而不是走完整个点阵?
还有点阵的移动函数怎么理解?希望能举个简单例子,然后详细地讲解,谢谢!
对了,k是第几个字,2个138和2个595
#include <reg52.h>
#define uchar unsigned char
#define uint unsigned int
sbit r=P2^0;
sbit clk=P2^1;
sbit stb=P2^2;
uchar code table[3][32]={
{0x04,0x80,0x04,0x80,0x08,0x80,0x08,0x80,
0x10,0x84,0x20,0x84,0x40,0x7C,0x80,0x00,
0x00,0x00,0x3F,0xF0,0x02,0x00,0x02,0x00,
0x02,0x00,0x02,0x00,0x7F,0xFC,0x04,0x80,}, //无
{0x40,0x44,0xFC,0x48,0x40,0x30,0x00,0x22,
0x1C,0x52,0xE0,0x8A,0x43,0x06,0x00,0x02,
0x10,0x50,0x10,0x48,0x20,0x40,0x24,0x5C, // 线
0x45,0xE0,0xF8,0x40,0x10,0x5E,0x23,0xE0,},
{0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,
0x21,0x0A,0x01,0x02,0x01,0x02,0x00,0xFE,
0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,
0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,}
};
void writebyte(uchar dat)
{
uchar i;
for(i=0;i<8;i++)
{
dat=dat>>1;
r=CY;
clk=0;
clk=1;
}
}
void senddata()
{
stb=0;
stb=1;
}
void main()
{
uchar num,i,j,k;
while(1)
{
for(k=1;k<3;k++)
{
for(i=0;i<16;i++) //移动一个字
{
for(j=0;j<20;j++)
{
for(num=0;num<16;num++) //移动一位
{
if(i<8)
{
writebyte(((table[k][2*num]>>(8-i))|(table[k][2*num+1]<<i)));
writebyte(((table[k-1][2*num+1]>>(8-i))|(table[k-1][2*num]<<i)));
senddata();
}
else
{
writebyte(((table[k][2*num+1]>>(16-i))|(table[k][2*num]<<(i-8))));
writebyte(((table[k-1][2*num]>>(16-i))|(table[k-1][2*num+1]<<(i-8))));
senddata();
}
P1=num;
}
}
}
}
}
}
不错....学习