#include<reg52.h>
#define uint unsigned int
#define uchar unsigned char
uchar code table[]={
0xc0,0xf9,0xa4,0xb0,
0x99,0x92,0x83,0xf8,
0x80,0x98,0x88,0x83,
0xc6,0xa1,0x86,0x8e
};
sbit scl=P2^0;
sbit sda=P2^1;
uint baiwei,gewei,shiwei;
void delay_pcf8591(uchar z);
void delay(uchar z);
void init_pcf8591();
void start_pcf8591();
void stop_pcf8591();
void ack_pcf8591();
void write_pcf8591_byte(uchar add);
uint read_pcf8591_byte();
uint readpcf8951_adc();
void display();
/******************************************************************
主函数
/
void main()
{
init_pcf8591();
while(1)
{
display();
}
}
/
初始化函数
/
void init_pcf8591()
{
sda=1;
scl=1;
}
/
PCF8491转化程序
最新推荐文章于 2022-06-16 11:33:24 发布