I was trying to use the motor driver, but the motors aren't spinning for some reason.
I am sure the motors are working; I tried and tested them. I can't understand if there is a problem with the code, motor driver or the Arduino board.
Arduino board used: Arduino UNO R3
Here is the code:
char data; //Serial
void setup() {
// put your setup code here, to run once:
pinMode(4, OUTPUT);
pinMode(5, OUTPUT);
pinMode(6, OUTPUT);
pinMode(7, OUTPUT);
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
if (Serial.available()) {
data = Serial.read();
Serial.println(data);
}
if (data == '1') {
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
digitalWrite(6,HIGH);
digitalWrite(7,LOW);
}
}