I am using a qik 2s9v1 motor controller to drive 4 polulu micro gear motors. the motors are wired as 2 pairs, one pair per channel.
I am using an arduino duelmilanove controller. The error light comes on and the motors stop when the motors are instructed to change direction. I have been unable to get the error code so far.
this generally causes a failure. i do set the motors to coast briefly between transitions. It seems to work reasonably well on USB power, but when using the 7.4 180 mah 20c lipo battery it fails often
any ideas would be appreciated.
#include <SoftwareSerial.h>
#define rxPin 4
#define txPin 6
#define reset 5
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
void setup() {
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(reset,OUTPUT);
mySerial.begin(9600); // set the data rate for the SoftwareSerial port
digitalWrite(reset, LOW);
delay(100);
digitalWrite(reset, HIGH);
delay(10);
mySerial.write(0xAA);
delay(100);
}
void loop(){
mySerial.write(0x88); //M0 forward
mySerial.write(0x7F); //M0 speed
mySerial.write(0x8C); //M1 forward
mySerial.write(0x7F); //M1 speed
delay(2000);
mySerial.write(0x86);
mySerial.write(0x87);
delay(200);
mySerial.write(0x8A); //M0 forward
mySerial.write(0x7F); //M0 speed
mySerial.write(0x8E); //M1 forward
mySerial.write(0x7F); //M1 speed
delay(2000);
mySerial.write(0x86);
mySerial.write(0x87);
delay(200);
}