Arduino and L298N board

I have built a robot with an Arduino Nano and an L298N board. Power is provided by a 9V battery and the L298N board is connected to the Arduino Nano as follows:

EnA: D11
In1: D7
In2: D6
In3: D5
In4: D4
EnB: D3

My code is as follows:

#define ENA 11
#define IN1 7
#define IN2 6
#define IN3 5
#define IN4 4
#define ENB 3

void forwd(){
  digitalWrite(7, HIGH);
  digitalWrite(5, HIGH);
  digitalWrite(4, LOW);
  digitalWrite(6, LOW);
}

void reverse(){
  digitalWrite(7, LOW);
  digitalWrite(5, LOW);
  digitalWrite(4, HIGH);
  digitalWrite(6, HIGH);
}

void left(){
  digitalWrite(7, HIGH);
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(6, HIGH);
}

void right(){
  digitalWrite(7, LOW);
  digitalWrite(5, HIGH);
  digitalWrite(4, HIGH);
  digitalWrite(6, LOW);
}

void stopall(){
  digitalWrite(7, LOW);
  digitalWrite(5, LOW);
  digitalWrite(4, LOW);
  digitalWrite(6, LOW);
}
void setup() {
  pinMode(ENA, OUTPUT);
  pinMode(IN1, OUTPUT);
  pinMode(IN2, OUTPUT);
  pinMode(IN3, OUTPUT);
  pinMode(IN4, OUTPUT);
  pinMode(ENB, OUTPUT);
  analogWrite(ENA, 100);
  analogWrite(ENB, 100);
}

void loop() {
  forwd();
  delay(1000);
  reverse();
  delay(1000);
  left();
  delay(1000);
  right();
  delay(1000);
  stopall();

}

However when I run the code, nothing seems to happen. The code is meant to run the robot in every direction, one at a time, for one second each. Is there any way I can improve my code?

Why define names to barely use them?

And how is the battery and motors wired?

The code is probably o.k. but if "9V battery" means one of those little rectangular PP3 smoke detector batteries then they are useless for driving any type motor. They simply cannot deliver enough current. Try it with 6 x AA batteries instead.

Oh and make sure you have the Arduino GND and the L298 ground connected together. You didn't mention connecting them and failing to do that is a guaranteed way to stop everything from working.

Steve

I just realised that the 9V battery was flat, so problem solved. Do you have any tips on using an IR remote control with this?