Trying to fix expected primary-expression before ')' token

just want to figure out why its not right cheers.

/////////////////motors/////
int A = 8;
int B = 9;
int C = 10;
int D = 11;
/////////////////delays/////
int T = 5;
int H = 4;
int DS = 1;
int DP = 2;
////////////////steprate///////
int Wstep = 510;
int Fstep = 510;
int Dstep = 510;
int DPstep = 510;
////////////////rotation////////
int Rot = 0;
/////////////////pause//////////
int Pause = 250;
/////////////////////////////

void setup() {
  // put your setup code here, to run once:
  pinMode(A, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(D, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  if (Serial.available())
  {
    Rot = Serial.parseInt();
    int CMD = Serial.parseInt();
    for (int i = 0; i < Rot; ++) {
      switch (CMD) {
        case 1: Wavedrive(); break;
        case 2: Fulldrive(); break:
        case 3: Doublestep(); break:
        case 4: Dualphase(); break:
      }
    }
  }
}

void WaveD = drive() {
  for (int 1 = 0; 1 < Wstep; i++) {
    digitalWrite(A, 1); digitalWrite(D, 0);
    delay (T);
    digitalWrite(B, 1); digitalWrite(A, 0);
    delay (T);
    digitalWrite(C, 1); digitalWrite(B, 0);
    delay(T);
    digitalWrite(D, 1); digitalWrite(C, 0);
    delay (T);
  }
  digitalWrite(D, 0);
  delay (Pause);
}

void Fullstep() {
  for (inti = 0; i < Fstep; i++) {
    digitalWrite(A, 1); digitalWrite(C, 0);
    delay(T);
    digitalWrite(B, 1); digitalWrite(D, 0);
    delay(T);
    digitalWrite(C, 1); digitalWrite(A, 0);
    delay(T);
    digitalWrite(D, 1); digitalWrite(B, 0);
    delay(T);
  }
  digitalWrite(C, 0);
  digitalWrite(D, 0);
  delay(Pause);
}

void Doublestep() {
  for (int i = 0; i < Dstep; i++) {
    digitalWrite(A, 1);
    delay(DS);
    digitalWrite(B, 1);
    delay(DS);
    digitalWrite(A, 0);
    delay(DS);
    digitalWrite(C, 1);
    delay(DS);
    digitalWrite(B, 0);
    delay(DS);
    digitalWrite(D, 1);
    delay(DS);
    digitalWrite(C, 0;
                 delay(DS);
                 digitalWrite(A, 1);
                 delay(DS);
                 digitalWrite(D, 0);
  }
  digitalWrite(A, 0);
  delay(pause);

  void Dualphase() {
    for (int i = 0 < DPstep; i++) {
      digitalWrite(D, 0);
      digitalWrite(A, 1);
      digitalWrite(B, 1);
      delay(DP);
      digitalWrite(A, 0);
      digitalWrite(B, 1);
      digitalWrite(C, 1);
      delay(DP);
      digitalWrite(B, 0);
      digitalWrite(C, 1);
      digitalWrite(D, 1);
      delay(DP);
      digitalWrite(C, 0);
      digitalWrite(D, 1);
      digitalWrite(A, 1);
      delay(DP);
    }
    digitalWrite(A, 0);
    digitalWrite(D, 0);
    delay(pause);
  }

No code tags. if you'd use the IDE format code thingy you'd get a closer look at the issue.

And your error message bites. Why not copy and paste the one from the IDE?

Look where the error message highlights in red, that's where the problem is. Look closely at what you have put, there is something missing.

Read this: How to get the best out of this forum especially the bit about posting code and error messages.

Oops.

The compiler will have given you a message telling you to a pretty good degree of accuracy where the problem was, but you made us go searching.
Why?

Oops again.

 (int 1 = 0; 

And again

seems the initial culprit is here

for (int i = 0; i < Rot; ++) {

++ what ?

then you get into the issues such as

void WaveD = drive() {

and thus the unknown function Wavedrive()

The compiler will give you a line number for that expected primary-expression error, so check if there is anything odd about that line in the code.

cheers guys apologies for the shotty topic post, i thought i had copied the error message too but obviously not. hope it wasn't to annoying. il fix those issues and see where im at. cheers

@goodcat3d, your topic has been moved to a more suitable location on the forum. Installation and Troubleshooting is not for problems with (nor for advise on) your project :wink: See About the Installation & Troubleshooting category.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.