Β© 2026 Hedgehog Software, LLC
Failed to open the bus: No such file or directory
modprobe i2c-dev
#include <linux/i2c-dev.h> #include <fcntl.h> #include <unistd.h> #include <sys/ioctl.h> int main() { int file; char *bus = "/dev/i2c-1"; if ((file = open(bus, O_RDWR)) < 0) { perror("Failed to open the bus"); return 1; } return 0; }