I want to drive a dc motor with UNO arduino and L298P (that has a buzzer)
but ican’t ,
plz help me for writing a code

Here’s the image attached to the top post so others don’t have to download it to view it.


Here’s link to instruction how to insert an uploaded image into a post (for next time).

I think it’s a good idea to test a new h-bridge without a microcontroller so you can be sure which pins need to be set high and low in order to drive a motor. Here’s a link to a video I make showing how to use inexpensive L298N boards. L298N and L298P are pretty much the same chip. The “P” version is surface mount and the “N” version is through hole.

Some L298 boards use inverters on the direction pins so the direction of a motor can be controlled with a single pin. We would need to see some sort of schematic to know how the L298P is controlled and which I/O pins need to be used. If you provide a link to the shield you’re using, it would be easier for others to help you. Many vendors offer example code for use with items they sell. Did your vendor supply any example code?

What are you using as a power supply? What motors are you using?

At first thaks for your attention
I use 2 motor DC 12v
And litium polymer for power of motors
I used L298N cod for it, but it didn't work :frowning:
If U give me a simple code,,, very simple without PWM and sth else, its really useful for me
Just about running and direction of it
Exactly i dont know witch pin this shield give for input and enable,
Thanx alot

Exactly i dont know witch pin this shield give for input and enable,

But neither do I. Do you have a link for your shield?

What code did you try?

(Forum posts aren't text messages. Please use "you" not "U" and "I" not "i".)
(And while I'm asking, periods would be nice (just one please (as it says in section 10 of "How to use this forum - please read".))

Ok :-/

Here is the link of L298P ;

I need a simple cod for driving 2 motor DC

Thank You

Since you don't have a datasheet for your board, you will need to figure out how your board is wired.

I think there's a good chance your board is an adaptation/clone of the Arduino L298P board. You could use the L298 datasheet and multimeter to figure out how the board is connected.

I've noticed many of these L298P boards use an inverter on the direction control pins. This allows one to control the direction of the motor with a single I/O pin.

You might want to try some code intended for the Arduino motor shield to see if it works with your board.

cross posts are not appreciated ...