|
8*8LED仿真proteus遇到問(wèn)題了,求大神指導(dǎo)!! 如下代碼能正常顯示一個(gè)張字,可是不想用ord數(shù)組,直接利用oxfe悠移動(dòng)與0x01或運(yùn)算得出控制行標(biāo),(用程序中//后的代替該行,最后補(bǔ)p=(p<<1)|0x01;)反而沒(méi)有結(jié)果,求賜交!!!
XJS}J]4Y_8J@9$S7DJ4K2F3.png (41.08 KB, 下載次數(shù): 109)
下載附件
2017-4-9 19:52 上傳
#include <reg51.h>
#include <intrins.h>
#define uchar unsigned char
sbit sh=P2^0;
sbit ds=P2^1;
sbit st=P2^2;
code TAB[]={0xE9,0x2A,0xEC,0x9F,0xEC,0x2A,0xED,0x00};
code ord[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
void delay(int s)
{
int i;
for(i=0;i<s;i++)
{
_nop_();
_nop_();
_nop_();
}
}
void main()
{
uchar p=0xfe,q;
int i,j;
for(i=0;i<8;i++)
{
q=ord;//q=p;
st=0;
for(j=0;j<8;j++)
{
q=q<<1;
ds=CY;
sh=0;
delay(1);
sh=1;
}
st=1;
P0=TAB;
delay(10);
// p=(p<<1)|0x01;
}
}
|
|