|
|
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);
|
|