I have Arduino Uno and I attached it to 2 DC motors with L298N bridge. I want to control the speed of the motors so they don't move at maximum speed. I use analogWrite() but it does nothing,and the motors move at maximum speed
Here is my code:
//motor A
int enA = 9;
int in1 = 8;
int in2 = 7;
I think this is a hardware issue. Try dimming an LED with pins 3 and 9 (don't forget current
limiting resistor), once you know that's working make sure the enable pins function with
plain digitalWrite - ie checking the L298 is working.
How are you powering the motor(s)? Is the supply upto the task? If not you might be causing
dropouts in the supply.
@MarkT the problem is not with the arduino ,i tried the led and its works just fine and i tried the motors on another arduino but the problem still exist
i am powering the motors with 15v and it works fine on 8v
the only thing i didn't try is checking if there is a problem with the L298
thank you for response and sorry for my bad language
MarkT:
I think this is a hardware issue. Try dimming an LED with pins 3 and 9 (don't forget current
limiting resistor), once you know that's working make sure the enable pins function with
plain digitalWrite - ie checking the L298 is working.
How are you powering the motor(s)? Is the supply upto the task? If not you might be causing
dropouts in the supply.
@MarkT the problem is not with the arduino ,i tried the led and its works just fine and i tried the motors on another arduino but the problem still exist
i am powering the motors with 15v and it works fine on 8v
the only thing i didn't try is checking if there is a problem with the L298
thank you for response and sorry for my bad language
MarkT:
Your language is OK! ('bad' language means 'offensive' language (!), you mean 'poor English', but its not a problem, it all makes sense)
Thanks again but I have one more question ,
Could it be becuse of the L298 is not an orginal version (the place where I bought from only have Chinese copy)
My friend is facing the same problem
And is there any alternative way to slow down the dc motors