Boss lady
Boss lady
DIIDevHeads IoT Integration Server
Created by Boss lady on 7/2/2024 in #middleware-and-os
How do I set the I2C (Mpu-6050) slave address in my application?
@Middleware & OS Hello Guys, how do I set the I2C (Mpu-6050) slave address in my application, am getting the error Failed to acquire bus access and/or talk to slave: Input/output error but i have Checked the wiring and confirmed the slave device address. here's my code below
int addr = 0x48; // The I2C address of the slave device
if (ioctl(file, I2C_SLAVE, addr) < 0) {
perror("Failed to acquire bus access and/or talk to slave");
return 1;
}

int addr = 0x48; // The I2C address of the slave device
if (ioctl(file, I2C_SLAVE, addr) < 0) {
perror("Failed to acquire bus access and/or talk to slave");
return 1;
}

7 replies