L298N Driver - Code Issuing - " expected primary-expression before '=' token"

Hello Arduino Community,

Code is shown at bottom - please read below

I've been working on a little project that uses the L298N Dual Motor Driver to run a single motor.

Using this link I set up my project (disregard Using the L298N with PIC Section) :

How to Use L298N Motor Driver | Microcontroller Tutorials.

  1. I connected my wires and checked them and their connections for any problems.

  2. I am using 1 motor instead of two

  3. I am using two 'C' Duracell Alkaline Batteries, connected them together in a series circuit. I've tested the batteries and they run my Small Round Electric Motor with 12000 RPM + 3 to 6V DC perfectly when I don't connect the battery and motor to the L298N Driver.

  4. The two, 'C' batteries are 1.5 volts each (connecting them together in series give me 3 volts)

  5. I am connecting my arduino uno to a newly purchase laptop - I've compiled codes from this computer that have worked fine.

I copied and pasted the code from the website at the link at the top. I checked device manager and chose the correct port with the correct board, so I am starting to believe there is something wrong with the code on the website.

Once I compile the program, errors pop up stating, "expected primary-expression before '=' token" for every line of code that has a #defined variable (mentioned on the top lines of the program).

It would be helpful to please comment your thoughts and solutions for this issue.

Thank you.

Here is the code below, it is also available in the link at the top of this post:

#define EnA = 10;
#define EnB = 5;
#define In1 = 9;
#define In2 = 8;
#define In3 = 7;
#define In4 = 6;

void setup()
{
// All motor control pins are outputs
pinMode(EnA, OUTPUT);
pinMode(EnB, OUTPUT);
pinMode(In1, OUTPUT);
pinMode(In2, OUTPUT);
pinMode(In3, OUTPUT);
pinMode(In4, OUTPUT);
}
void goStraight() //run both motors in the same direction
{
// turn on motor A
digitalWrite(In1, HIGH);
digitalWrite(In2, LOW);
// set speed to 150 out 255
analogWrite(EnA, 200);
// turn on motor B
digitalWrite(In3, HIGH);
digitalWrite(In4, LOW);
// set speed to 150 out 255
analogWrite(EnB, 200);
delay(2000);
// now turn off motors
digitalWrite(In1, LOW);
digitalWrite(In2, LOW);
digitalWrite(In3, LOW);
digitalWrite(In4, LOW);
}
void loop()
{
goStraight();
delay(1000);
}

(deleted)

spycatcher2k:
#define EnA = 10;

should be

#define EnA 10

modify the other also.

or even better

const int EnA = 10;

Make all your constants constant

K thanks, works now!