|
51单片机开发板 8*8点阵 显示东西 旁边的灯是淡亮的 怎么关闭~
代码如下~~
#include <reg52.h>
#define Dianzhen_PORT P0 // 点阵P0负端口
sbit SEK = P3^4; //传数值
sbit SRC = P3^6; //锁数值
sbit RCK = P3^5; //上升沿
typedef unsigned char u8;
void Hc595MIstan(u8 dat)
{
u8 i = 0, j = 0;
SRC = 0; // 将SCK置为初始状态
RCK = 0; // RCK置为初始状态
for (i=0; i<8; i++)
{
SEK = dat >> 7;
dat <<= 1;
SRC = 1;
j++; // 延时代码
j++; // 延时代码
SRC = 0;
}
RCK = 1;
j++;
j++;
}
void YanShi();
void PDSALING1()
{
Hc595MIstan(0x01);
Dianzhen_PORT = ~0x66;
Hc595MIstan(0x02);
Dianzhen_PORT = ~0x99;
Hc595MIstan(0x04);
Dianzhen_PORT = ~0x81;
Hc595MIstan(0x08);
Dianzhen_PORT = ~0x42;
Hc595MIstan(0x10);
Dianzhen_PORT = ~0x24;
Hc595MIstan(0x20);
|
|