I'm hoping someone is can help me with this code. It uploads ok, but the motors don't run. Pololu suggested that the libary needs to be update. I'm new to Aurduinos and its beyond my abilities. Any help is appreciated!
Thanks,
Tom
include <CompactQik2s9v1.h> // From pololu.com or ARB Support Site
#include <SoftwareSerial.h>
#define rxPin 3
#define txPin 2
#define rstPin 4
SoftwareSerial mySerial = SoftwareSerial(rxPin, txPin);
CompactQik2s9v1 motor = CompactQik2s9v1(&mySerial,rstPin);
void setup() {
mySerial.begin(9600);
motor.begin();
motor.stopBothMotors();
}
void loop() {
// Both motors forward
doDelay();
motor.motor0Forward(127); // Left motor
motor.motor1Forward(127); // Right motor
delay (2000);
// Both motors reverse
doDelay();
motor.motor0Reverse(127);
motor.motor1Reverse(127);
delay (2000);
// Turn left
doDelay();
motor.motor0Reverse(127);
motor.motor1Forward(127);
delay (2000);
// Turn right
doDelay();
motor.motor0Forward(127);
motor.motor1Reverse(127);
delay (2000);
}
void doDelay() { // Short delay between transitions
motor.motor0Forward(0);
motor.motor1Forward(0);
delay (250);
}