/************************************************
跳線設置:默認跳線位
************************************************/
#include"AT89x52.h"
#include"math.h"
#define uint unsigned int
#define uchar unsigned char
sbit DUAN=P2^6; //74HC573的LE端 U1 LED的段選端
sbit WEI=P2^7; //74HC573的LE端 U2 LED的位選端
main()
{
WEI=1; //讓位選的這個74hc573處于直通狀態,也就是輸入0,輸出也是0,輸入1輸出也是1
P0=0; //P0口送低電平
WEI=0; //鎖存 也就是保持74hc573現在這個時刻的輸出狀態一直不變
DUAN=1; //讓74hc573處于直通狀態,也就是輸入0,輸出也是0,輸入1輸出也是1
P0=0xFF; //P0口全送高電平
DUAN=0; //鎖存 也就是保持74hc573現在這個時刻的輸出狀態一直不變
while(1)
{
;
}
}
歡迎光臨 (http://m.zg4o1577.cn/bbs/) | Powered by Discuz! X3.1 |