error: expected constructor, destructor, or type conversion before '(' token.

int currentLED = 2;
int delayValue = 200;

void setup() {
 // initialize digital pin 12 as input;
 pinMode(12, INPUT); // button input

 // initialize digital pin 2 to 5 as output:
 pinMode(2, OUTPUT); // white LED
 pinMode(3, OUTPUT); // yellow LED
 pinMode(4, OUTPUT); // green LED
 pinMode(5, OUTPUT); // red LED
}

int checkInput() {
 if (digitalRead(12) == 0){
   return 1;
 } else {
  return 0;
 }
}


void loop() {
 // Check if the button is press at the right moment
 if (digitalRead(12) == 0 ) {
   if (currentLED == 4 )
   // Blink the correct (green) LED
   digitalWrite(4, HIGH);
   delay(200);
   digitalWrite(4, LOW);
   delay(200);
   digitalWrite(4, HIGH);
   delay(200);
   digitalWrite(4, LOW);
   delay(200)

   // Speed up the LEDs
   ;delayValue = delayValue - 20;
   
 } else {
   //Blink the wrong LED
   digitalWrite(currentLED, HIGH);
   delay(200);
   digitalWrite(currentLED, LOW);
   delay(200);
   digitalWrite(currentLED, HIGH);
   delay(200);
   digitalWrite(currentLED, LOW);
   delay(200);
 }
}
// Loop LED from white --> yellow --> green --> red
digitalWrite(currentLED, HIGH),
delay(delayValue);
digitalWrite(currentLED, LOW);
delay(delayValue);
currentLED = currentLED + 1;
if (currentLED > 5) {
 currentLED = 2;
}
}

the error is on line: delay(delayValue);
I dont know what to do please help me!

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

Look at the end of the line before that.

Pete

  ;delayValue = delayValue - 20;

The error message doesn't mean putting a semicolon on this line, it means go back to the line above and put it there. The line above may be some distance back, if there's comments.

Remove the extra brace after the close of the else. You have two.

The automatic code formatting gives you the clue.

mioservo.attach(8);
Very pretty. Why no code tags around the code to make it readable and easy to copy ?

  for (angolo = 85; angolo < 149; angolo += 1) // angolo abbassa// {

I spy a comment followed by a brace on the same line so the brace is commented out. Move the brace to its own line.

Arduino: 1.6.13 (Windows 10), Board: "Arduino/Genuino Uno"

sim900amini:22: error: expected constructor, destructor, or type conversion before '(' token

pinMode(trigPin, OUTPUT);

^

sim900amini:23: error: expected constructor, destructor, or type conversion before '(' token

pinMode(echoPin, INPUT); // accept wave

^

sim900amini:24: error: expected constructor, destructor, or type conversion before '(' token

pinMode(led1, OUTPUT);

^

sim900amini:25: error: expected constructor, destructor, or type conversion before '(' token

pinMode(led2, OUTPUT);

^

sim900amini:27: error: expected constructor, destructor, or type conversion before '(' token

pinMode(RELAY1, OUTPUT);

^

sim900amini:29: error: expected unqualified-id before '/' token

/

^

Multiple libraries were found for "SoftwareSerial.h" Used: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SoftwareSerial Not used: C:\Users\USER\Documents\Arduino\libraries\SoftwareSerial exit status 1 expected constructor, destructor, or type conversion before '(' token

This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.

/ can anyone tell me which part are wrong?

can anyone tell me which part are wrong?

As you have not posted the code that caused the errors it is unlikely that help can be provided, don't you think ?

Newbie here not seeing where the error is. Can someone point it out to me? Get the: expected constructor, destructor, or type conversion before '(' token on line: pinMode(MonoLED, OUTPUT) above the void setup

const int Left_channel = A0; const int Right_channel = A1; const int Cough = 13; const int Talk = 12; const int Mono = 11; const int CoughLED = 10; const int TalkLED = 9; const int MonoLED = 8; pinMode(Cough, INPUT); pinMode(Talk, INPUT); pinMode(Mono, INPUT); pinMode(CoughLED, OUTPUT); pinMode(TalkLED, OUTPUT); pinMode(MonoLED, OUTPUT);

void setup() {

Serial.begin(9600);

}

void loop() {

int coughState = digitalRead(Cough); int talkState = digitalRead(Talk); int monoState = digitalRead(Mono);

if (coughstate == HIGH) { digitalWrite(CoughLED, HIGH) } else if (talkState == HIGH) { digitalWrite(TalkLED, HIGH) } else if (monoState == HIGH) { digitalWrite(MonoLED, HIGH) }

}

Also, is this the correct way to post code for review or is there another feature in here that I should be using? Thank you for any guidance.

-- Gene

pinMode(Cough, INPUT);
pinMode(Talk, INPUT);
pinMode(Mono, INPUT);
pinMode(CoughLED, OUTPUT);
pinMode(TalkLED, OUTPUT);
pinMode(MonoLED, OUTPUT

Move to setup()

Please remember to use code tags when posting code

Just to help me understand, what things have to be in the setup and what things have to be in the setup? I'm guessing since I declared both variables and functions above the setup that is a no-go. But I have seen several examples where variables are declared before the setup. Thanks for the guidance.

--Thanks, Gene

I have seen several examples where variables are declared before the setup.

That makes the variables globally available throughout the program and is commonly done. However, all code, such as calling the pinMode() function, must itself be within a function.

Any variables defined in setup() are visible only to setup(), so OK for loop controls or temporary values, but no use if you want to see them in other functions.

All your digitalWrite statements are missing a semi-colon as well. And the correct way to post code is by using code tags.

Type [code]
Paste your code after that
Type [/code] after the pasted code

// RemoteXY select connection mode and include library
#define REMOTEXY_MODE__HARDSERIAL

#include <RemoteXY.h>

// RemoteXY connection settings
#define REMOTEXY_SERIAL Serial
#define REMOTEXY_SERIAL_SPEED 9600
#define REMOTEXY_ACCESS_PASSWORD “toptech2008”
int button1 = 22;
int button2 = 24;
int button3 = 26;
int button4 = 28;
int button5 = 30;
int button6 = 32;
int button7 = 34;
int button8 = 36;
int button9 = 38;
int button10 = 40;
int button11 = 42;
int button12 = 44;

int PIN_RELAY1 = 53;
int PIN_RELAY2 = 51;
int PIN_RELAY3 = 49;
int PIN_RELAY4 = 47;
int PIN_RELAY5 = 45;
int PIN_RELAY6 = 43;
int PIN_RELAY7 = 41;
int PIN_RELAY8 = 39;
int PIN_RELAY9 = 37;
int PIN_RELAY10 = 35;
int PIN_RELAY11 = 33;
int PIN_RELAY12 = 31;

int status= false;

// RemoteXY configurate
#pragma pack(push, 1)
uint8_t RemoteXY_CONF =
{ 255,13,0,62,0,12,2,11,122,5,
2,1,4,8,21,9,0,205,94,24,
24,79,78,0,79,70,70,0,2,1,
4,23,21,8,0,205,94,24,24,79,
78,0,79,70,70,0,2,1,35,9,
21,8,0,205,94,24,24,79,78,0,
79,70,70,0,2,1,35,23,21,8,
0,205,94,24,24,79,78,0,79,70,
70,0,2,1,4,37,21,8,0,205,
94,24,24,79,78,0,79,70,70,0,
2,1,4,51,21,8,0,205,94,24,
24,79,78,0,79,70,70,0,2,1,
35,36,21,9,0,205,94,24,24,79,
78,0,79,70,70,0,2,1,35,50,
21,9,0,205,94,24,24,79,78,0,
79,70,70,0,2,1,4,64,21,8,
0,205,94,24,24,79,78,0,79,70,
70,0,2,1,35,63,21,9,0,205,
94,24,24,79,78,0,79,70,70,0,
2,1,36,76,20,9,0,205,94,24,
24,79,78,0,79,70,70,0,2,1,
5,77,20,8,0,205,94,24,24,79,
78,0,79,70,70,0,65,4,27,10,
5,5,0,65,4,57,77,5,5,0,
65,4,57,64,5,5,0,65,4,57,
51,5,5,0,65,4,57,38,5,5,
0,65,4,57,9,5,5,0,65,4,
57,24,5,5,0,65,4,27,51,5,
5,0,65,4,27,65,5,5,0,65,
4,27,78,5,5,0,131,1,0,93,
63,5,1,2,31,72,111,109,101,32,
65,117,116,111,109,97,116,105,111,110,
32,66,121,32,84,111,112,32,84,101,
99,104,0,69,1,15,8,10,10,0,
69,1,5,7,10,10,0,69,1,36,
8,9,9,0,69,1,46,7,10,10,
0,69,1,5,22,10,10,0,69,1,
14,22,10,10,0,69,1,36,22,10,
10,0,69,1,46,22,10,10,0,69,
1,5,36,10,10,0,69,1,15,36,
10,10,0,69,1,36,35,10,10,0,
69,1,17,50,10,10,0,69,1,5,
50,10,10,0,69,1,47,36,10,10,
0,69,1,36,62,10,10,0,69,1,
46,50,10,10,0,69,1,36,49,10,
10,0,69,1,47,23,10,10,0,69,
1,18,75,10,10,0,69,1,16,63,
10,10,0,69,1,5,76,10,10,0,
69,1,4,63,10,10,0,69,1,37,
75,10,10,0,69,1,46,76,10,10,
0,65,4,27,25,5,5,0,65,4,
27,39,5,5,0,4,128,5,0,55,
7,0,2,26,69,1,46,63,10,10,
0 };

// this structure defines all the variables and events of your control interface
struct {

// input variables

uint8_t PIN_RELAY_1; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_2; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_7; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_8; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_3; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_4; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_9; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_10; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_5; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_11; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_12; // =1 if switch ON and =0 if OFF
uint8_t PIN_RELAY_6; // =1 if switch ON and =0 if OFF
int8_t PIN_RELAY_13; // =0…100 slider position

// output variables

uint8_t PIN_RELAY_1_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_13_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_12_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_11_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_10_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_7_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_9_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY_4_r; // =0…255 LED Red brightness
uint8_t _5_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY__6_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY__2_r; // =0…255 LED Red brightness
uint8_t PIN_RELAY__3_r; // =0…255 LED Red brightness

// other variable

uint8_t connect_flag; // =1 if wire connected, else =0

} RemoteXY;
#pragma pack(pop)

/////////////////////////////////////////////
// END RemoteXY include //
/////////////////////////////////////////////

#define PIN_RELAY_1 53
#define PIN_RELAY_2 51
#define PIN_RELAY_7 41
#define PIN_RELAY_8 39
#define PIN_RELAY_3 49
#define PIN_RELAY_4 47
#define PIN_RELAY_9 37
#define PIN_RELAY_10 35
#define PIN_RELAY_5 45
#define PIN_RELAY_11 33
#define PIN_RELAY_12 31
#define PIN_RELAY_6 43

#include <IRremote.h>

int RECV_PIN = 12; //tsop1738 output pin connected to D8
#define buzzer 10 //buzzer conected pin 12

int a = 1;
int b = 1;
int c = 1;
int d = 1;
int e = 1;
int f = 1;
int g = 1;
int h = 1;
int i = 1;
int j = 1;
int k = 1;
int l = 1;

IRrecv irrecv(RECV_PIN);

decode_results results;

int receiver = 3;
IRrecv IRrecv(receiver);
decode_results Results;

#include <TimerOne.h>
volatile int m = 0; // Variable to use as a counter
volatile boolean zero_cross=0; // Boolean to store a “switch” to tell us if we have crossed zero
int AC_pin = 5; // Output to Opto Triac

int dim2 = 0; // led control
int dim = 128; // Dimming level (0-128) 0 = on, 128 = 0ff
int freqStep = 75; // This is the delay-per-brightness step in microseconds.

void setup()
{
RemoteXY_Init ();

pinMode (PIN_RELAY_1, OUTPUT);
pinMode (PIN_RELAY_2, OUTPUT);
pinMode (PIN_RELAY_7, OUTPUT);
pinMode (PIN_RELAY_8, OUTPUT);
pinMode (PIN_RELAY_3, OUTPUT);
pinMode (PIN_RELAY_4, OUTPUT);
pinMode (PIN_RELAY_9, OUTPUT);
pinMode (PIN_RELAY_10, OUTPUT);
pinMode (PIN_RELAY_5, OUTPUT);
pinMode (PIN_RELAY_11, OUTPUT);
pinMode (PIN_RELAY_12, OUTPUT);
pinMode (PIN_RELAY_6, OUTPUT);

// TODO you setup code
pinMode(PIN_RELAY_1, OUTPUT);
pinMode(button1, INPUT_PULLUP);

pinMode(PIN_RELAY_2, OUTPUT);
pinMode(button2, INPUT_PULLUP);

pinMode(PIN_RELAY_3, OUTPUT);
pinMode(button3, INPUT_PULLUP);

pinMode(PIN_RELAY_4, OUTPUT);
pinMode(button4, INPUT_PULLUP);

pinMode(PIN_RELAY_5, OUTPUT);
pinMode(button5, INPUT_PULLUP);

pinMode(PIN_RELAY_6, OUTPUT);
pinMode(button6, INPUT_PULLUP);

pinMode(PIN_RELAY_7, OUTPUT);
pinMode(button7, INPUT_PULLUP);

pinMode(PIN_RELAY_8, OUTPUT);
pinMode(button8, INPUT_PULLUP);

pinMode(PIN_RELAY_9, OUTPUT);
pinMode(button9, INPUT_PULLUP);

pinMode(PIN_RELAY_10, OUTPUT);
pinMode(button10, INPUT_PULLUP);

pinMode(PIN_RELAY_11, OUTPUT);
pinMode(button11, INPUT_PULLUP);

pinMode(PIN_RELAY_12, OUTPUT);
pinMode(button12, INPUT_PULLUP);
}

digitalWrite()
digitalWrite(PIN_RELAY_1, LOW);
digitalWrite(PIN_RELAY_2, LOW);
digitalWrite(PIN_RELAY_3, LOW);
digitalWrite(PIN_RELAY_4, LOW);
digitalWrite(PIN_RELAY_5, LOW);
digitalWrite(PIN_RELAY_6, LOW);
digitalWrite(PIN_RELAY_7, LOW);
digitalWrite(PIN_RELAY_8, LOW);
digitalWrite(PIN_RELAY_9, LOW);
digitalWrite(PIN_RELAY_10, LOW);
digitalWrite(PIN_RELAY_11, LOW);
digitalWrite(PIN_RELAY_12, LOW);
Serial.begin(9600);

irrecv.enableIRIn(); // Start the IR receiver (classic remote)
pinMode()
pinMode(AC_pin, OUTPUT); // Set the Triac pin as output
attachInterrupt()
attachInterrupt(0, zero_cross_detect, RISING); // Attach an Interupt to Pin 2 (interupt 0) for Zero Cross Detection
Timer1.initialize(freqStep); // Initialize TimerOne library for the freq we need
Timer1.attachInterrupt(dim_check, freqStep);
}

void zero_cross_detect()
{
zero_cross = true; // set the boolean to true to tell our dimming function that a zero cross has occured
i=0;
digitalWrite(AC_pin, LOW);
}
// Turn on the TRIAC at the appropriate time

void dim_check()
{
if(zero_cross == true) {
if(m>=dim) {
digitalWrite(AC_pin, HIGH); // turn on light
m=0; // reset time step counter
zero_cross=false; // reset zero cross detection
}
else {
i++; // increment time step counter
}}}

void translateIR() // takes action based on IR code received
{
switch(results.value)
{
case 33464415:
{

if (dim<127)  

{
dim = dim + 8;
if (dim>127)
{
dim=128; // in vechiul sketch era 127
}
}}

break;

case 33448095:
{

  {

if (dim>5)
{
dim = dim - 8;
if (dim<0)
{
dim=0; // in vechiul sketch era 1
} }}}
break;
}}

void loop()
{
RemoteXY_Handler ();

digitalWrite(PIN_RELAY_1, (RemoteXY.PIN_RELAY__1==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_2, (RemoteXY.PIN_RELAY__2==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_7, (RemoteXY.PIN_RELAY__7==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_8, (RemoteXY.PIN_RELAY__8==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_3, (RemoteXY.PIN_RELAY__3==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_4, (RemoteXY.PIN_RELAY__4==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_9, (RemoteXY.PIN_RELAY__9==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_10, (RemoteXY.PIN_RELAY__10==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_5, (RemoteXY.PIN_RELAY__5==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_11, (RemoteXY.PIN_RELAY__11==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_12, (RemoteXY.PIN_RELAY__12==0)?LOW:HIGH);
digitalWrite(PIN_RELAY_6, (RemoteXY.PIN_RELAY__6==0)?LOW:HIGH);

// TODO you loop code
// use the RemoteXY structure for data transfer
// do not call delay()
int fanspeed = RemoteXY.PIN_RELAY__13 * 2.5

;analogWrite (1, fanspeed)

;if (digitalRead(button1) == true) {
status = !status;
digitalWrite(PIN_RELAY_1, status);
} while(digitalRead(button1) == true);
delay(50);

;if (digitalRead(button2) == true) {
status = !status;
digitalWrite(PIN_RELAY_2, status);
} while(digitalRead(button2) == true);
delay(50);

;if (digitalRead(button3) == true) {
status = !status;
digitalWrite(PIN_RELAY_3, status);
} while(digitalRead(button3) == true);
delay(50);

;if (digitalRead(button4) == true) {
status = !status;
digitalWrite(PIN_RELAY_4, status);
} while(digitalRead(button4) == true);
delay(50);

;if (digitalRead(button5) == true) {
status = !status;
digitalWrite(PIN_RELAY_5, status);
} while(digitalRead(button5) == true);
delay(50);

;if (digitalRead(button6) == true) {
status = !status;
digitalWrite(PIN_RELAY_6, status);
} while(digitalRead(button6) == true);
delay(50);

;if (digitalRead(button7) == true) {
status = !status;
digitalWrite(PIN_RELAY_7, status);
} while(digitalRead(button7) == true);
delay(50);

;if (digitalRead(button8) == true) {
status = !status;
digitalWrite(PIN_RELAY_8, status);
} while(digitalRead(button8) == true);
delay(50);

;if (digitalRead(button9) == true) {
status = !status;
digitalWrite(PIN_RELAY_9, status);
} while(digitalRead(button9) == true);
delay(50);

;if (digitalRead(button10) == true) {
status = !status;
digitalWrite(PIN_RELAY_10, status);
} while(digitalRead(button10) == true);
delay(50);

;if (digitalRead(button11) == true) {
status = !status;
digitalWrite(PIN_RELAY_11, status);
} while(digitalRead(button11) == true);
delay(50);

;if (digitalRead(button12) == true) {
status = !status;
digitalWrite(PIN_RELAY_12, status);
} while(digitalRead(button12) == true);
delay(50);
}

if (irrecv.decode(&results))
{
Serial.println(results.value, HEX);

{
  if (results.value == 0x1FE48B7) // paste your hex code

  {
    a++;
    int x = a % 2;
    digitalWrite(53, x);
  }
  else if (results.value == 0x1FE50AF) //paste your hex code
  {

    b++;
    int x = b % 2;
    digitalWrite(51, x);
  }
  else if (results.value == 0x1FED827) //paste your hex code
  {
    c++;
    int x = c % 2;
    digitalWrite(49, x);
  }
  else if (results.value == 0x1FEF807) ///paste your hex code
  {
    b++;
    int x = d % 2;
    digitalWrite(47, x);
  }

{
if (results.value == 0x1FE48B7) // paste your hex code

  {
    a++;
    int x = e % 2;
    digitalWrite(45, x);
  }
          int x = f % 2;
    digitalWrite(43, x);
  }
}

} else if (results.value == 0x1FEF807) ///paste your hex code
{
c++;
int x = g % 2;
digitalWrite(41, x);
}
else if (results.value == 0x1FEF807) ///paste your hex code
{
b++;
int x = h % 2;
digitalWrite(39, x);
}

  if (results.value == 0x1FE48B7) // paste your hex code

  {
    a++;
    int x = i % 2;
    digitalWrite(37, x);
  }

else if (results.value == 0x1FED827) //paste your hex code
{int x = j % 2;
digitalWrite(35, x);
}

else if (results.value == 0x1FED827) //paste your hex code
{
c++;
int x = k % 2;
digitalWrite(33, x);
}
else if (results.value == 0x1FEF807) ///paste your hex code
{
b++;
int x = l % 2;
digitalWrite(31, x);
}

  irrecv.resume(); //resume,continue recieving ir-signals
  
   if (irrecv.decode(&results)) // have we received an IR signal?

{
translateIR();
irrecv.resume(); // receive the next value
}

}

}

}

Error: exit status 1
expected unqualified-id before ‘{’ token