新问题,编译不通过。以下是我的程序
#include <p24Fxxxx.h>
#include <stdio.h>
#include <i2c.h>
int main (void)
{
unsigned char add = 0x11;/* address is 0x11*/
unsigned int configure1;
unsigned int configure2 = 0x76;/*set baud rate as 100kHz,FCY is 12MHz*/
configure1 = (I2C_ON & I2C_IDLE_CON & I2C_CLK_HLD &
I2C_IPMI_DIS & I2C_7BIT_ADD &
I2C_SLW_DIS & I2C_SM_DIS &
I2C_GCALL_DIS & I2C_STR_DIS &
I2C_NACK & I2C_ACK_DIS & I2C_RCV_DIS &
I2C_STOP_DIS & I2C_RESTART_DIS &
I2C_START_DIS);
/*CW2 &=0xFB;*//*multiplexes the module to the ASCL1 and ASDA1 pins*/
OpenI2C(configure1,configure2);
IdleI2C();
StartI2C();
MaserWriteI2C(add);
while(I2C1STATbits.ACKSTAT = 0);
MaserWriteI2C(0x0);
StopI2C();
while(I2C1CONbits.PEN);
CloseI2C();
}
请帮个忙吧,不识别#include <i2c.h>吗? |