Thanks for everyone who helped and gave suggestions. I'm happy to say that our vehicle works now. Although our new problem is that it tends to curve to the left now. We gave the same amount of speed for each motor so we're not entirely sure why it's doing that. If anyone has any suggestions or advice feel free to help. Thank ya.
Sincerely,
Less desperate high school student
#include <AFMotor.h>
#include <AFMotor.h>
AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwmAF_DCMotor motor(3, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
AF_DCMotor Amotor(3, MOTOR12_64KHZ); // create motor #2, 64KHz pwmAF_DCMotor motor(3, MOTOR12_64KHZ); // create motor #2, 64KHz pwm
AF_DCMotor Bmotor(4,MOTOR12_64KHZ);
AF_DCMotor Cmotor(1,MOTOR12_64KHZ);
void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");
motor.setSpeed(255);// set the speed to 200/255
Amotor.setSpeed(255);
Bmotor.setSpeed(255);
Cmotor.setSpeed(255);
}
void loop() {
Serial.print("tick");
motor.run(FORWARD); // turn it on going forward
Amotor.run(BACKWARD);
Bmotor.run(FORWARD);
Cmotor.run(FORWARD);
delay (23000);\
Serial.print("tack");
motor.run(RELEASE); // stopped
Amotor.run(RELEASE);
Bmotor.run(RELEASE);
Cmotor.run(RELEASE);
delay (100000);
}