Re: Stepper Shield Lemonade Stand
We had the initial shield with the two stepper motors controlling the conveyor belt and fill sensor working well. Now we are stacking two shields. The top (0 x 60) running the conveyor and fill sensor placement, and the bottom (0 x 61) running the horizontal and vertical laser.
Adafruit_MotorShield AFMStop(0x60);// Default address- no jmpers.
Adafruit_MotorShield AFMSbot(0x61); // Rightmost jumper closed Adafruit_MotorShield AFMStop(0x60);
Adafruit_StepperMotor *myStepper1 = AFMStop.getStepper(200,1);
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200,2);
Adafruit_StepperMotor *myStepper3 = AFMSbot.getStepper(200,1);
Adafruit_StepperMotor *myStepper4 = AFMSbot.getStepper(200,2);
AFMSbot.begin(); // Start the bottom shield
AFMStop.begin(); // Start the top shield
Serial.begin(9600); // set up Serial library at 9600 bps Serial.println("Stepper test!");
myStepper1->setSpeed(100); //conveyor speed
myStepper2->setSpeed(30); //fill sensor speed
myStepper3->setSpeed(20); //laser horizontal
myStepper4->setSpeed(50); //laser vertical speed
At this juncture when we try to use the stepper, ie
myStepper1->step(1000, FORWARD, DOUBLE);
in a voidloop, we get "myStepper1 not declared in this scope". it previously worked with a single shield. This has to be easy, but we can't make it debug. Any thoughts.