C51 的程序用 PCF8591 基于 89C52 的程序,求各位大神帮忙看看哪里错了
#include<reg52.h>#include<intrins.h>
#define PCF8591 0x90
#define THCO 0xee
#define TLCO 0x0
sbit SDA=P3^7;
sbit SCL=P3^6;
bit ack;
unsigned char Val;
unsigned char num;
#include<I2c.h>
unsigned char code Duan[]={0x3F, 0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F};//共阴极数码管,0-9段码表
unsigned char Data_Buffer[4]={0,0,0,0};//四个数码管显示数值,数组变量定义
bit flag=0;//1秒时间到标志
sbit P24=P2^4; //四个数码管的位码口定义
sbit P25=P2^5;
sbit P26=P2^6;
sbit P27=P2^7;
sbit P14=P1^4;
sbit LED1=P3^4; //两个指示灯
sbit LED2=P3^5;
unsigned char read()
{
Start_I2c();
SendByte(0x90);
if(ack==0) return 0;
SendByte(0x40);
Start_I2c();
SendByte(0x91);
if(ack==0) return 0;
// RcvByte();
Val=RcvByte();
// Ack_I2c(1); //发送非就答位