|
點陣的一系列東西怎樣實現(xiàn)的,為什么程序輸上去沒有任何反應(yīng)呢?
我用的是74hc595來擴(kuò)展的I/O口。請各位幫忙指點一下,謝謝。
#include<reg51.h>
#include<intrins.h>
#define uchar unsigned char
#define uint unsigned int
sbit RCLK=P3^5;
sbit SER=P3^4;
sbit SRCLK=P3^6;
void Hc595SendByte(uchar dat)
{
uchar a;
SRCLK=0;
RCLK=0;
for(a=0;a<8;a++)
{
SER=dat>>7;
dat<<=1;
SRCLK=1;
_nop_();
_nop_();
SRCLK=0;
}
RCLK=1;
_nop_();
_nop_();
RCLK=0;
}
void main()
{
Hc595SendByte(0x80);
P0=0x7f;
while(1);
}
|
|