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?
Thanks for pointing that out, @Marvee Amasi . Here's the part of my code where I open the I2C bus:
int file;
if ((file = open("/dev/i2c-0", O_RDWR)) < 0) {
perror("Failed to open the i2c bus");
return 1;
}
int file;
if ((file = open("/dev/i2c-0", O_RDWR)) < 0) {
perror("Failed to open the i2c bus");
return 1;
}
It seems like I might be using the wrong I2C bus. I have changed it to /dev/i2c-1 . I appreciate the suggestion!
7 replies