unexpected unqualified id before '/' token ----- can someone point out my error

/* Multiple State Handling

  • 05-22-2019
    */

#define button 3 //Push button on D3
#define lowbeam 5 //Low Beam on D5
#define highbeam 6 //High Beam on D6
#define gate 7 //Gate on D7
/------------------------------------------------------------------------
int state = 0; //integer to hold current state
int old = 0; //integer to hold last state
int buttonPoll = 0; //integer to hold button state
/-------------------------------------------------------------------------
void setup() {
pinMode(button,INPUT); //button set as input
pinMode(lowbeam,OUTPUT); //relays set as outputs
pinMode(highbeam,OUTPUT);
pinMode(gate,OUTPUT);

digitalWrite(lowbeam,LOW); //initial state as off
digitalWrite(highbeam,LOW); //initial state as off
digitalWrite(gate,LOW); //initial state as off
}
/-------------------------------------------------------------------------
void loop() {

//debouncing routine to read button
buttonPoll = digitalRead(button); //poll state of button
if(buttonPoll == 1){ //check if it has been pressed
delay(50); //wait 50msec
buttonPoll = digitalRead(button); //poll button again
if(buttonPoll == 0){ //if it is 0 consider 1 press
state = old +1; //increase state by 1
}}
else{ //if button has not been pressed
deley(100); //wait 100ms
}
switch (state) { //react to button press & state
case 1: //if state is 1
digitalWrite(lowbeam,HIGH); //lowbeam relay on
digitalWrite(highbeam,LOW); //highbeam relay off
digitalWrite(gate,LOW); //gate relay off
old = state; //set old state as current state
break;
case 2:
digitalWrite(lowbeam,LOW);
digitalWrite(highbeam,HIGH);
digitalWrite(gate,LOW);
old = state;
break;
case 3:
digitalWrite(lowbeam,LOW);
digitalWrite(highbeam,LOW);
digitalWrite(gate,HIGH);
old = state;
break;
default: //if state if no 1,2,3
digitalWrite(lowbeam,LOW); //all relays off
digitalWrite(highbeam,LOW);
digitalWrite(gate,LOW);
old = 0; //reset to all off/state 0
break;
}
}

Single line comments require *two * slashes.

/............................
will give an error

//..................................... or /................................/ is accepted

pinMode(button,INPUT);                //button set as input
buttonPoll = digitalRead(button);     //poll state of button
  if(buttonPoll == 1){                  //check if it has been pressed

Do you have a pulldown resistor (10k) on pin 3? If not, the above will not work as expected.

the error message means you have punctuation errors. an extra ), a missing comma or semicolon, or

void loop() {
 
                                        //debouncing routine to read button
  buttonPoll = digitalRead(button);     //poll state of button
  if(buttonPoll == 1){                  //check if it has been pressed
    delay(50);                          //wait 50msec
    buttonPoll = digitalRead(button);   //poll button again
    if(buttonPoll == 0){                //if it is 0 consider 1 press
      state = old +1;                   //increase state by 1
    }}

that double curly brace

read the bottom half of my signature line

pssst, fnb111 gave you the answer. Click his 'add karma' button.

ChrisTenone:
pssst, fnb111 gave you the answer. Click his 'add karma' button.

So did dougp :grinning: