Skip to main content
1 of 3
Davido
  • 131
  • 1
  • 5

Raspberry Pi - how to use I2C and GPIO at the same time?

I'm working on a project where I need to use GPIO to toggle pins high and low as well as gather sensor data from an I2C peripheral. I have each component working separately, GPIO using wiringPi and I2C using open(...,...) and ioctl(...,...,...). Separately they work great. When I run them together, the I2C bus gets in a state where i2cdetect shows all possible address values, and I can't communicate with the I2C device again until I reboot. Has anyone seen this before or does anyone know what I can do to fix this? I've tried only using wiringPi as well, and it breaks using both GPIO and I2c at the same time.

Davido
  • 131
  • 1
  • 5