Previous

This is the 19th example in a series of examples for arduino beginners. For more examples click these buttons or select a example from the grid at the bottom.

Next

Description

This is the 19th example in our arduino for beginners series and in this one we implement a bidirectional DC motor control using the popular L293D Quad H Bridge Drive IC. Using this circuit and example all the possible control options with a DC motor can be experiemented with.

Code

int analogInPin = A0;
int sensorValue1 = 0;

void setup() {
Serial.begin(9600);
pinMode(9, OUTPUT);
pinMode(10, OUTPUT);
}

void loop() {
sensorValue1 = analogRead(analogInPin);
Serial.println(sensorValue1);
if (sensorValue1 >= 300) {
digitalWrite(9, HIGH);
digitalWrite(10, LOW);
} else {
digitalWrite(10, HIGH);
digitalWrite(9, LOW);
}

delay(10);
}

Pictures / Video

Arduino for Beginners - DC Motor Control
Arduino for Beginners - DC Motor Control
Arduino for Beginners - DC Motor Control

Files

Arduino SketchFritzing File

Share This

Other Examples

| 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 |

Other Learning Resources