Problem coding L2n8 with Arduino mega

Mazhar535:
Can you plz explain code for two l298 drivers with same arduino.

See reply #1

add more #defines for the pin numbers and use them but please give them sensible names that indicate which motor driver they relate to.

Something like

// defining enable and input pins of L298 driver
#define rightMotorenA 5
#define rightMotorenB 6
#define rightMotorin1 7
#define rightMotorin2 8
#define rightMotorin3 9
#define rightMotorin4 10

#define leftMotorenA 11
#define leftMotorrenB 12
#define leftMotorin1 13
#define leftMotorin2 A0
#define leftMotorin3 A1
#define leftMotorin4 A2

Make sure to choose pin numbers that are not used elsewhere in your program.