标题: 自测24c02试验 [打印本页]

作者: 累不死的狗    时间: 2018-12-25 00:57
标题: 自测24c02试验
主程序部分如下所示
#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);
}


24C02试验.zip

24.06 KB, 下载次数: 5, 下载积分: 黑币 -5

24c02试验






欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1