Arduino 4 motor code

hello can anoyone help me for my arduino project

i have 1 arduino card
4 wheel base
look the picture i have to start the 4 wheel can anyone help me in the code ?

If you Google "Arduino 4-wheel robot" you will find many examples such things which have been built. Many of them include code.

If that's not enough try giving us some more information. For a start, what do you want the "4 wheel base" to do? What motors does it use? Do you already have a motor driver? Is it controlled by something (if so what?) or is it autonomous? What will it be powered with? What "arduino card" do you have?

Have you done anything yet? If you already have some code then post it here.

Steve

My motor ArG are not working the pin 0 and pin 1 never work but the 3 other motor work

// 1. les constante des pin moteur
const int motorAG = 2;
const int motorArG = 1;
const int motorAD = 6;
const int motorArD = 4;

const int motorAG1 = 3;
const int motorArG1 = 0;
const int motorAD1 = 7;
const int motorArD1 = 5;

void setup() {

Serial.begin(9600);

// indique les rôle des pin moteur
pinMode(motorAG,OUTPUT);
pinMode(motorArG,OUTPUT);
pinMode(motorAD,OUTPUT);
pinMode(motorArD,OUTPUT);

pinMode(motorAG1,OUTPUT);
pinMode(motorArG1,OUTPUT);
pinMode(motorAD1,OUTPUT);
pinMode(motorArD1,OUTPUT);

}

void loop() {

digitalWrite(motorAG,LOW);
digitalWrite(motorArG,LOW);
digitalWrite(motorAD,LOW);
digitalWrite(motorArD,LOW );

digitalWrite(motorAG,HIGH);
digitalWrite(motorArG,HIGH);
digitalWrite(motorAD,HIGH);
digitalWrite(motorArD,HIGH);

delay(1000);

exit(0);

}

Pins 0 and 1 are the hardware serial pins (attached to USB). You will need to choose different pins for the motors.

The code in your loop() function will effectively turn the motor pins HIGH, they will be LOW for only a few microseconds.

OK which pin should i use, ?
Can you change de pins for me, ?

It a car the will have line folower so i have to use 4 wheels,

And how can i inverse the rotation of motor ? You know because i have to turn rightvand left the car

OP's pic so we do not have to download

Yes so ? Actually i need some help in the program i need to know how can I start the 4 wheel and gow can I move reverse wheel

my pin 0 and 1 never start the motor and only 3 motors are working, groundFungus told me to change pin 0 and 1 but which pin should i use ?

You could use pins 8 and 9 instead of 0 and 1. What motor driver are you using?

this one

so the motor that is on 0 and 1 never work, and I forgot to told you I use this also

can you help me for reverse the motor rotation i need it for turn right and left

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks.. Tom.. :slight_smile: