For one of my highschool engineering projects I am using an Arduino UNO, servo motor, a 12V DC motor and a L298N motor controller running in a simple void loop function, and for the the code involving the digitalWright for the L298N controller i keep gettin an error that says "Expected declaration before '}' token" so i know it is an error in my token placement. Can someone please help me out this is due on monday and if i cant figure it out im screwed.
Heres my code:
#include <Servo.h>
int EnA = 9;
int In1 = 7;
int In2 = 8;
A very helpful troubleshooting tool is the Arduino IDE's Tools > Auto Format feature. If you do an Auto Format and then compare the resulting indentation to your intended program structure, it will quickly point you to where there is a missing or extra brace. In this case you already had the auto format and the answer was staring you right in the face. You just didn't look at what the indentation was trying to tell you.
Another useful feature of the Arduino IDE is that when you place the cursor next to one bracket, it puts a box around the matching bracket. If the cursor is next to the closing bracket and the opening bracket is off the screen then it will show the opening bracket line in a tool tip after a short delay.