I'm working with a port expander for the pi to run four stepper motors from python. It was working great until I tried to also use a GPIO pin on the pi (not on the port expander) as an output. I was using the RPi library to control pin 22 on the pi, and this seems to have caused the smbus library, which I was using to control the port expander, to throw an input/output error (Error number 5). The program sometimes works fine even with the GPIO pin enabled, but it will randomly throw the error and the stepper motors will not move. I'm still not entirely sure as to the cause of the problem, but it seems like the RPi library is fighting with the smbus library for control over the pins. Is it possible that this is the problem? I'm going to need to control all GPIO pins on the pi plus the port expander. Is there a recommended way to do this without provoking this issue?