[go: up one dir, main page]

0% found this document useful (0 votes)
25 views2 pages

Arduino Motor Control Setup

Uploaded by

shyam y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
25 views2 pages

Arduino Motor Control Setup

Uploaded by

shyam y
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

// Define motor pins

const int motor1Pin1 = 12;


const int motor1Pin2 = 11;

const int motor2Pin1 = 13;


const int motor2Pin2 = 7;

const int motor3Pin1 = 6;


const int motor3Pin2 = 5;

const int motor4Pin1 = 9;


const int motor4Pin2 = 10;

const int motor5Pin1 = 3;


const int motor5Pin2 = 8;

const int motor6Pin1 = 4;


const int motor6Pin2 = 2;

void setup() {
// Set motor pins as outputs
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);

pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);

pinMode(motor3Pin1, OUTPUT);
pinMode(motor3Pin2, OUTPUT);

pinMode(motor4Pin1, OUTPUT);
pinMode(motor4Pin2, OUTPUT);

pinMode(motor5Pin1, OUTPUT);
pinMode(motor5Pin2, OUTPUT);

pinMode(motor6Pin1, OUTPUT);
pinMode(motor6Pin2, OUTPUT);

// Set all motors to run forward


digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);

digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);

digitalWrite(motor3Pin1, HIGH);
digitalWrite(motor3Pin2, LOW);

digitalWrite(motor4Pin1, HIGH);
digitalWrite(motor4Pin2, LOW);

digitalWrite(motor5Pin1, HIGH);
digitalWrite(motor5Pin2, LOW);

digitalWrite(motor6Pin1, HIGH);
digitalWrite(motor6Pin2, LOW);
}
void loop() {
// No code needed in the loop for continuous running
}

You might also like