Well I am attempting to build a automated brass annealer with my Arduino UNO and the V2 motor shield and stepper motor.
I initially had the code written before I got the V2, and in simplicity it compiled with the standard stepper library. Now with the V2 I can not seem to make it happy.
Thanks in advance ! I am a newbie to this.....
Code: Select all
/*
automated annealer
button 2 for 308
button 3 for 22-250
button 4 for 6XC
button 5 for 260
Jake Freese
3/10/14
EDIT 3/21/14
*/
#include <Stepper.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_MCP23017.h>
#include <Adafruit_RGBLCDShield.h>
#include <Adafruit_MotorShield.h>
#include <AccelStepper.h>
#include <Wire.h>
#include "utility/Adafruit_PWMServoDriver.h"
Adafruit_MotorShield AFMS = Adafruit_MotorShield();
Adafruit_StepperMotor *myStepper1 = AFMS.getStepper(200, 2);
void forwardstep1() {
myStepper1->onestep(FORWARD, SINGLE);
}
AccelStepper Astepper1(forwardstep1);
// button 2 for 308 caliber
const int buttonPinA1 = A1;
// button 3 for 22-250 caliber
const int buttonPinA2 = A2;
// button 4 for 6XC caliber
const int buttonPinA3 = A3;
// button 5 for 260 caliber
const int buttonPinA4 = A4;
void setup()
{
Serial.begin(9600);
pinMode (buttonPinA1, INPUT);
pinMode (buttonPinA2, INPUT);
AFMS.begin();
// set the speed at 120 rpm:
Mystepper1.setSpeed(120);
// initialize the serial port:
}
// 308 settings
void loop() {
while (digitalRead(buttonPinA1) == HIGH)
// loop while button pressed
Serial.println("clockwise");
// number of steps required to index
myStepper1.step(400);
// time in flame
delay(400);
//22-250 settings
while (digitalRead(buttonPinA2) == HIGH)
// loop while button pressed
Serial.println("clockwise");
// number of steps required to index
myStepper1.step(400);
// time in flame
delay(300);
//6XC settings
while (digitalRead(buttonPinA3) == HIGH)
// loop while button pressed
Serial.println("clockwise");
// number of steps required to index
myStepper1.step(400);
// time in flame
delay(325);
//260 settings
while (digitalRead(buttonPinA4) == HIGH)
// loop while button pressed
Serial.println("clockwise");
// number of steps required to index
myStepper1.step(400);
// time in flame
delay(375);
}
annealer21:32: error: initializing argument 1 of 'AccelStepper::AccelStepper(uint8_t, uint8_t, uint8_t, uint8_t, uint8_t)'
annealer21.ino: In function 'void setup()':
annealer21:54: error: 'Mystepper1' was not declared in this scope
annealer21.ino: In function 'void loop()':
annealer21:64: error: request for member 'step' in 'myStepper1', which is of non-class type 'Adafruit_StepperMotor*'
annealer21:73: error: request for member 'step' in 'myStepper1', which is of non-class type 'Adafruit_StepperMotor*'
annealer21:82: error: request for member 'step' in 'myStepper1', which is of non-class type 'Adafruit_StepperMotor*'
annealer21:91: error: request for member 'step' in 'myStepper1', which is of non-class type 'Adafruit_StepperMotor*'
I eventually want to get the LCD to work with this also so when you have the button closed for the machine to run within the parameters it will show the caliber selected, programmed time, and countdown until the next move.
Thanks again in advance!!!