一、功能介紹
編輯程序使數(shù)碼管中數(shù)字亮起來。
二、程序代碼
#include
#define uchar unsigned char
uchar code SEG[1]={0x78};
void main(void)
{
while(1)
{
P1=SEG[0];
}
}
#include
#define uchar unsigned char
uchar code SEG[10]={0xc0,0xf9,0xa4,0xb0,0x99,0x92,0x82,0xf8,0x80,0x90};
void main(void)
{
while(1)
{
P1=SEG[0];
}
}
三、電路圖
四、小結(jié)
這是網(wǎng)課時(shí)的作業(yè),因?yàn)槔蠋熓蔷€上教學(xué)所以有很多不明白只能電話同學(xué)。好在問題最后都解決了。