I'm working on a project where I'm using the DRV8825 stepper motor driver with the AccelStepper library. I've got the Enable pin of the DRV8825 attached to a PCF8575 I2C multiplexer. I used the below code and it works perfectly, but not if I test with the multiplexer, and I've discovered that the stepper doesn't move even if I just include <PCF8575.h> (or even #include <Wire.h>) in the code. Any ideas how I can solve this?
#include "AccelStepper.h"
// #include <PCF8575.h>
// PCF8575 pcf8575(PCF8575_ADDR);
// Define stepper motor connections and motor interface type. Motor interface type must be set to 1 when using a driver:
#define dirPin 17
#define stepPin 21
#define motorInterfaceType 1
// Create a new instance of the AccelStepper class:
AccelStepper stepper = AccelStepper(motorInterfaceType, stepPin, dirPin);
void setup() {
Serial.begin(9600);
stepper.setMaxSpeed(1000);
}
void loop() {
stepper.setSpeed(250);
stepper.runSpeed();
}