pcf8591读写数据的代码的差别是什么?
写:
void write_ad(void)
{
int i;
IIC_Start();
IIC_SendByte(0x90);
IIC_WaitAck();
IIC_SendByte(0x03);
IIC_WaitAck();
IIC_Stop();
for (i=0;i<1000;i++);
}
读:
unsigned char read_ad(void)
{
unsigned char temp;
IIC_Start();
IIC_SendByte(0x91);
IIC_WaitAck();
temp = IIC_RecByte();
IIC_Ack(0);
IIC_Stop();
return temp;
}