找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 1257|回复: 0
收起左侧

自测24c02试验

[复制链接]
ID:453974 发表于 2018-12-25 00:57 | 显示全部楼层 |阅读模式
主程序部分如下所示
#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试验

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表