Go Down

Topic: Arduino Robot (Read 1 time) previous topic - next topic

SuperMiguel

so here is the code
Code: [Select]

#include <AFMotor.h>

AF_DCMotor motor1(1);
AF_DCMotor motor2(2);
AF_DCMotor motor3(3);
AF_DCMotor motor4(4);

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Motor test!");
 
  motor1.setSpeed(255);
  motor2.setSpeed(255);
  motor3.setSpeed(255);   
  motor4.setSpeed(255);     
}

void loop() {

  Serial.print("for");
  motor1.run(FORWARD); 
  motor2.run(FORWARD);
  motor3.run(FORWARD); 
  motor4.run(FORWARD); 
  delay(5000);

  Serial.print("back");
  motor1.run(BACKWARD);
  motor2.run(BACKWARD);
  motor3.run(BACKWARD);
  motor4.run(BACKWARD);   
  delay(5000);
 
  Serial.print("tack");
  motor1.run(RELEASE);
  motor2.run(RELEASE); 
  motor3.run(RELEASE);
  motor4.run(RELEASE); 
  delay(5000);

}


When i use it look what i get :
http://www.youtube.com/watch?v=W73aXAHiEsw

Why is it doing that to go to the front??

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy