0
void sensorConfig(void)
{
    float buffer[SIZE];
    char index = 0;
    I2C1_Initialize();
    I2C1_Open();
    I2C1_MasterWrite(0xC7);
    while(1)
    {
        for(index=0;index<SIZE;index++)
        {
            buffer[ index ] = I2C1_MasterRead(ACCEL_XOUT_H + index);
        }  
    }
    I2C1_Close();        
}
void I2C1_Initialize()
{
    SSP1STAT = 0x80;
    SSP1CON1 = 0x08;
    SSP1CON2 = 0x00;
    SSP1ADD  = 0x09;
    SSP1CON1bits.SSPEN = 0;
}

error message:

main.c:118:: error: (1098) conflicting declarations for variable "_I2C1_Initialize" (mcc_generated_files/i2c1_master.c:167)

I am trying to establish a I2C connection between MPU6050 accelerometer and pic18f45k22

  • 1
    Is there a variable with the same name of `I2C1_Initialize` function in the `i2c1_master.c` or in your `main.c` file? – Kozmotronik Nov 14 '22 at 06:09

0 Answers0