Hello!
We are trying to get a motor and a H bridge working together so that the motor can turn forward and backward.
However, it doesn't work, and we don't know why.
Our program and our set-up are copied from this video :
(it's in french but nevermind)
Here is the program :
int in1 = 8;
int in2 = 7;
void setup() {
pinMode(in1, OUTPUT);
pinMode(in2, OUTPUT);
}
void loop() {
digitalWrite(in1, 0);
digitalWrite(in2, 0);
delay(3000);
digitalWrite(in1, 1);
digitalWrite(in2, 0);
delay(3000);
digitalWrite(in1, 0);
digitalWrite(in2, 0);
delay(3000);
digitalWrite(in1, 0);
digitalWrite(in2, 1);
delay(3000);
}
And here is the circuitry:
Thanks for your help!
EDIT : Thanks to everyone who helped, I don't really know what we did but it works now, so problem solved!
Hello leogal
Take a view here to gain the knowledge.
HTH
p.s. Your powersupply could be to small to run the motor as well.
Thanks for your answer.
However, it seems a little bit too complex for what we want to do...
if you want to do what you say you want to do, there is no more simple way.
Go to library manager, search on L298, pick one of the libraries, try the examples.
Use a 6xAA (9V) battery pack to power the motors, instead of the 3xAA (4.5V) pack shown in the picture.
Make sure that all the grounds are connected.
In addition be carefull while connecting power source
1 Like
xfpd
May 3, 2023, 5:14pm
8
leogal:
a little bit too complex
Dronebotworkshop makes very good written articles with accompanying videos that I find thorough, and understandable at a beginner knowledge level.
https://dronebotworkshop.com/dc-motor-drivers/
system
Closed
October 30, 2023, 5:15pm
9
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.