Hi !
We've been working on a school project and would like to make a motor turn both ways at a varying speed with an h bridge.
Right now, we're only trying to test if it works correctly (without making the speed vary) with a rather simple program. However, we can't seem to get it right.
Our problem is that we ran the same tests last year for another project, and we had no problems. (We lost last year's program so we made another one, but I'm pretty sure it's basically the same)(I also don't think that the circuit is any different).
Here is the program we're using :
int in1 = 7;
int in2 = 8;
void setup() {
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
}
void loop() {
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
delay(3000);
digitalWrite(in1, HIGH);
digitalWrite(in2, LOW);
delay(6000);
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
delay(5000);
digitalWrite(in1, LOW);
digitalWrite(in2, HIGH);
delay(6000);
digitalWrite(in1, LOW);
digitalWrite(in2, LOW);
delay(5000);
}
And here is our system :
There's probably something wrong, but we don't know what.
Thanks for your help ! ![]()
(Apologies in advance if there are any spelling/grammar/whatever mistakes, english is not my native language)
EDIT : Nevermind we're just a little stupid, problem solved ![]()

