Code Not Working

The error message is: exit status 1
expected ')' before ';' token
It highlights line 19 but I can't see an error.

This is the code:
int (enA; 10);
int (in1: 9);
int (in2;);

void setup() {
pinMode(enA; OUTPUT);
pinMode(in1; OUTPUT);
pinMode(in2; OUTPUT);

}

void loop()
{
analogWrite(enA; 255);
digitalWrite(in1; HIGH);
digitalWrite(in2; LOW);
delay(2000);
digitalWrite(in1; LOW);
digitalWrite(in2; LOW);
delay(5000);
}

sketch_nov12a.ino (635 Bytes)

Please READ THIS POST to help you get the best out of the forum.

SIMPLE TROUBLESHOOTING.

These steps may also save you some unnecessary time and effort in the forum.

  • Always provide as much detail as possible to your issue it may be important.

  • If applicable provide your SKETCH inside CODE TAGS ( </> ) or a CREATE share link.

  • If applicable provide a schematic even if hand drawn.
    COMMON ISSUES

  • Check you have a COMMON GROUND where required.

  • Where possible use USB 2.0 ports or a USB 2.0 POWERED HUB to rule out USB 3.0 issues.

  • Try other computers where possible.

  • Try other USB leads where possible.

  • You may not have the correct driver installed. CH340/341 or CP2102

  • There may be a problem with the board check your wiring first.

  • Remove any items connected to pins 0 and 1.
    COMPUTER RELATED

  • Ensure you turn off any additional security / antivirus just to test.

  • There may be a problem with the PC try RESTARTING it.

  • You may be selecting the wrong COM port.

  • Avoid cloud/network based installations where possible OR ensure your Network/Cloud software is RUNNING.

  • Clear your browsers CACHE.

  • Close the IDE before using any other serial programs.

  • Preferably install IDE's as ADMINISTRATOR or your OS equivalent

Performing the above actions may help resolve your problem without further help.

Bob.

int (enA; 10);
int (in1: 9); ????
int (in2;); ?????? :o

You cannot use ; in place of ,. Check the Language Reference for the syntax of the functions that you are using.

See what this do:

int enA = 10;
int in1 = 9;
int in2 = ?;  // What pin number?

void setup() {
  pinMode(enA, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
}

void loop()
{
  analogWrite(enA, 255);
  digitalWrite(in1, HIGH);
  digitalWrite(in2, LOW);
  delay(2000);
  digitalWrite(in1, LOW);
  digitalWrite(in2, LOW);
  delay(5000);
}

This is code for an L298N but it says; expected ')' before ';' token in line 24, can anyone help?
int (enA; 10);
int (in1; 9);
int (in2; 8);

int (enA; 10);
int (in1; 9);
int (in2; 8);

void setup() {
pinMode(enA; OUTPUT);
pinMode(in1; OUTPUT);
pinMode(in2; OUTPUT);
}

void loop() {
analogWrite(enA; 255);
digitalWrite(in1; HIGH);
digitalWrite(in2; LOW);
delay(2000);
digitalWrite(in1; LOW);
digitalWrite(in2; HIGH);
delay(5000);
digitalWrite(in1; LOW);
digitalWrite(in2; LOW);
}

sketch_nov15a.ino (370 Bytes)

You are using semi colons where there should be commas and variable declarations do not get parenthesis but do use the equal sign. Here is a page on variable declaration. The language reference will help with the syntax of all the Arduino functions.

int enA = 10;
int in1 = 9;
int in2 = 8;

void setup()
{
   pinMode(enA, OUTPUT);
   pinMode(in1, OUTPUT);
   pinMode(in2, OUTPUT);
}


void loop()
{
   analogWrite(enA, 255);
   digitalWrite(in1, HIGH);
   digitalWrite(in2, LOW);
   delay(2000);
   digitalWrite(in1, LOW);
   digitalWrite(in2, HIGH);
   delay(5000);
   digitalWrite(in1, LOW);
   digitalWrite(in2, LOW);
}

Read the how to use this forum-please read sticky to see how to properly post code and some advice on how to ask an effective question. Remove useless white space and format the code with the IDE autoformat tool (crtl-t or Tools, Auto Format) before posting code.

@Space_Stalin

Second warning so next time you will go on a short break.
Your other post now MERGED

Bob.

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html .
Then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Can you tell us your electronics, programming, arduino, hardware experience?

Thanks.. Tom... :slight_smile: