|
主程序部分如下所示
#include "iic.h"
unsigned char table[]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f}; 数码管显示部分
unsigned char address[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07}; 写入地址部分
unsigned int a[]={0xf0};
void Delay900ms();
unsigned int i,s;
void main()
{
for(i=0;i<8;i++)
{
P1=rdbyte_24c02(address[i]);
Delay900ms();
}
while(1)
{
for(i=0;i<8;i++)
{
wrbyte_24c02(address[i],table[0]);
}
}
}
void Delay900ms() //@11.0592MHz
{
unsigned char i, j, k;
_nop_();
i = 7;
j = 78;
k = 167;
do
{
do
{
while (--k);
} while (--j);
} while (--i);
}
|
|