Every thing works except for the stepper motor which wont spin.
Thanks in advance .
these are the parts that I am using
MOVI Shield
MOVI - Audeme
Arduino Uno
Motor Driver
Stepper Motor Driver
Here is the Code :
#include "MOVIShield.h" // Include MOVI library, needs to be *before* the next #include
#if defined(ARDUINO_ARCH_AVR) || defined(ARDUINO_ARCH_PIC32)
#include <SoftwareSerial.h> // This is nice and flexible but only supported on AVR and PIC32 architecture, other boards need to use Serial1
#include <Stepper.h>
#endif
int servoPin = 9;
int motor1pin1 = 2;
int motor1pin2 = 3;
int motor2pin1 = 4;
int motor2pin2 = 5;
const int stepsPerRevolution = 500;
Stepper myStepper(stepsPerRevolution, 8, 9, 10, 11);
MOVI recognizer(true); // Get a MOVI object, true enables serial monitor interface, rx and tx can be passed as parameters for alternate communication pins on AVR architecture
void setup()
{
recognizer.init(); // Initialize MOVI (waits for it to boot)
recognizer.callSign("Lazy"); // Train callsign Arduino (may take 20 seconds)
recognizer.addSentence("Get me water"); // Add sentence 1
recognizer.train();
pinMode(motor1pin1, OUTPUT);
pinMode(motor1pin2, OUTPUT);
pinMode(motor2pin1, OUTPUT);
pinMode(motor2pin2, OUTPUT);
myStepper.setSpeed(100);
Serial.begin(9600);
//*
// Note: training can only be performed in setup().
// The training functions are "lazy" and only do something if there are changes.
// They can be commented out to save memory and startup time once training has been performed.
// Train (may take 20seconds)
//*/
// recognizer.setThreshold(5); // uncomment and set to a higher value (valid range 2-95) if you have a problems due to a noisy environment.
}
void loop() // run over and over
{
signed int res=recognizer.poll(); // Get result from MOVI, 0 denotes nothing happened, negative values denote events (see docs)
if (res==1) { // Sentence 1.
Serial.println("clockwise");
myStepper.step(stepsPerRevolution);
delay(500);
// step one revolution in the other direction:
Serial.println("counterclockwise");
myStepper.step(-stepsPerRevolution);
delay(500);
delay(30000);
digitalWrite(motor1pin1, HIGH);
digitalWrite(motor1pin2, LOW);
digitalWrite(motor2pin1, HIGH);
digitalWrite(motor2pin2, LOW);
delay(1000);
digitalWrite(motor1pin1, HIGH);
digitalWrite(motor1pin2, LOW);
digitalWrite(motor2pin1, HIGH);
digitalWrite(motor2pin2, LOW);
delay(5000);
digitalWrite(motor1pin1, LOW);
digitalWrite(motor1pin2, LOW);
digitalWrite(motor2pin1, LOW);
digitalWrite(motor2pin2, LOW);
recognizer.say("Ariving now");
delay(999999);
}
}`Preformatted text`