Pixy Cam Robot

I'm building a robot with a Pixy cam and an Arduino Uno. If you're not familiar with it, the Pixy tracks color. I am starting basic and just having it track along the x-axis, turning its head left and right to keep an object centered in its line of sight. It worked fine attached to a DC motor, but I thought a stepper would give me better accuracy, and that's where my problems have started.

The stepper motor works, and the circuit is set up properly. I know this because everything ran fine using the example code found in IDE. Once I connected my Pixy to the Uno and ran code extremely similar to the DC code, the stepper started trying to move, but just ended up as a vibrating box. I believe the problem probably lies in the code. Has anyone had similar issues?

Here's the code.

pixystepper.ino (1.51 KB)

95% of the problems Arduino beginners have with motors are due to inadequate motor power supplies and motor drivers.

For informed help, post a hand-drawn wiring diagram (not Fritzing) and the links to the data sheets or product pages to the motor, motor driver and motor power supply.

Thanks. Now how would I go about fixing this? Would it be in this section?

Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);

void setup() {

pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
pinMode(11, OUTPUT);

Got it. Shifted everything up two pins and it's working now. Thank you very much.